Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-17 Thread Kris Deugau
David Harkness wrote: I've never used the old-style constructors, but perhaps the semantics of parent:: changed and you need to instead use $this- as in $this-Tag(option, $name); That's a total guess. I don't have 5.2 handy to try it out, but both work in 5.3 using a simple example. Can

Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-17 Thread Kris Deugau
Nathan Nobbe wrote: 2. try modifying Tag SelectBoxOption to have __construct() instead of Tag() SelectBoxOption(), then call parent::__construct() from inside of SelectBoxOption::__construct(); see if that clears up your problem under 5.2 (read: this will only be a partial solution as it

Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-16 Thread Kris Deugau
Nathan Nobbe wrote: Why not test for the type of $name at each point of interest in the SelectBoxOption constructor? If you're passing a string value to the constructor it almost has to be getting changed by the Tag constructor, right ? class SelectBoxOption extends Tag { function

Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-16 Thread Nathan Nobbe
On Thu, Dec 16, 2010 at 3:21 PM, Kris Deugau kdeu...@vianet.ca wrote: Nathan Nobbe wrote: Why not test for the type of $name at each point of interest in the SelectBoxOption constructor? If you're passing a string value to the constructor it almost has to be getting changed by the Tag

Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-16 Thread David Harkness
It's acting as if Tag's constructor a) declares $name as a reference using $name, and b) is assigning itself ($this) to $name for some (probably bad) reason. That's the only way I can see that $name inside SelectBoxOption's constructor could change from a string to an object. A peek at Tag's

Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-16 Thread Nathan Nobbe
On Thu, Dec 16, 2010 at 3:21 PM, Kris Deugau kdeu...@vianet.ca wrote: Nathan Nobbe wrote: Why not test for the type of $name at each point of interest in the SelectBoxOption constructor? If you're passing a string value to the constructor it almost has to be getting changed by the Tag