Re: strange behavior on manipulating the array of class object
| From: | Moriyoshi Koizumi | Date: | Tue, 26 Jun 2001 23:57:15 +0000 |
| Subject: | Re: strange behavior on manipulating the array of class object | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55303@lists.php.net to get a copy of this message | ||
Hello,
Thanks for your great advice,
and also the tutorial http://www.aditus.nu/jpgraph/jpg_phpoo.php
helps so much.
I guess I was confusing a copy of object and a reference of object.
btw that's too confusing!
"Gyozo Papp" <pgerzson@freestart.hu> wrote:
> Hello,
>
> I've not tried your code yet, but after examining it a short while I think your problem is
> that PHP's copying behaviour. It means that assignments (including argument/parameter) *copy*
> values to the target variable no matter it is an object or a string or whatever.
> You should use references , perhaps it helps. The '&' is your very best friend!
> IMHO, current() and next() also returns just the copy of the array elements as well as
> "foreach" construct, beware of it.
>
> visit this one http://www.aditus.nu/jpgraph/jpg_phpoo.php
> there are some short examples of PHP's copying behaviour.