Re: [PHP] unexpected T_NEW on object property

2006-04-21 Thread Jochem Maas
M. Sokolewicz wrote: Jochem Maas wrote: Paul Barry wrote: .. Then I have another class: this is wrong. you can define the property in the class with a constant or scalar value (i.e. literal string, numeric value or an array) but not a return value of a function or a 'new' object. jus

Re: [PHP] unexpected T_NEW on object property

2006-04-21 Thread M. Sokolewicz
Jochem Maas wrote: Paul Barry wrote: .. Then I have another class: this is wrong. you can define the property in the class with a constant or scalar value (i.e. literal string, numeric value or an array) but not a return value of a function or a 'new' object. just to nag, an array is not

Re: [PHP] unexpected T_NEW on object property

2006-04-21 Thread Jochem Maas
Paul Barry wrote: .. Then I have another class: this is wrong. you can define the property in the class with a constant or scalar value (i.e. literal string, numeric value or an array) but not a return value of a function or a 'new' object. you should initialize the $address property in th

Re: [PHP] unexpected T_NEW on object property

2006-04-21 Thread Richard Lynch
On Fri, April 21, 2006 2:17 pm, Paul Barry wrote: > public $address = new Address(); I believe this is true: At this time, you can only initialize class properties to CONSTANTS. So you could use 'Address' or 42 or NULL or TRUE/FALSE, but not new Address(); Actually, I think an array might a

[PHP] unexpected T_NEW on object property

2006-04-21 Thread Paul Barry
With php5, I'm trying to create an object that has a property that is another object. First I have this class: Then I have another class: Then if I try to use the user object like this: name = 'Paul Barry'; $user->address->city = 'Washington'; ?> name ?> lives in address->city ?> I get th