Re: [PHP4BETA] problems with array_walk
| From: | Andrei Zmievski | Date: | Thu, 13 Apr 2000 13:19:57 +0000 |
| Subject: | Re: [PHP4BETA] problems with array_walk | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13498@lists.php.net to get a copy of this message | ||
On Thu, 13 Apr 2000, Sergio Garcia Murillo wrote:
> function change($o)
> {
> $o->change();
> }
> function show($o)
> {
> $o->show();
> }
> $obj[1] = new x();
> $obj[2] = new x();
> array_walk($obj,'change');
> reset($obj);
> array_walk($obj,'show');
>
> ?>
>
> the output is 0 0 instead of 1 1 is this the eay it's supposed to work or
> it's a bug (in php3 i have none of the
> two problems)
Declare your functions like this:
function change(&$o)
{
}
-Andrei
Nobody tried to design Windows - it just grew in random
directions without any kind of thought behind it.