Re: [PHP-DEV] arrays of objects From: Andrei Zmievski (andrei <email protected>)
Date: 02/04/00

On Fri, 04 Feb 2000, Stephanie Wehner wrote:
> This will print test1,test2,test1 . This would not be that annoyind cause I can
> do $some_array[0]->assignTest("foo") as well. However if I would do that in a class
> then things become a problem since I can't do $this->foo->bar() for example.
>
> Is there a way how this can still be done ? Or is it simply a bug ?

When you put objects in array it actually puts a copy in there not a
reference, and this results in the behavior you're seeing.

-Andrei
* There is no knowledge that is not power. *

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>