[PHP-DEV] Re: [PEAR-DEV] PHP arrays managment bug :-? From: Tomas V.V.Cox (cox <email protected>)
Date: 07/27/01

Cynic wrote:
>
> >> >
> >> >1) array_pop() bug:
> >> ><?php
> >> >$a = array();
> >> >$a[] = array('foo', 'bar');
> >> >print_r($a);
> >> >$a[] = array('foo2', 'bar2');
> >> >print_r($a);
> >> >$a = array_pop($a);
> >> >print_r($a);
> >> >?>
>
>
> so, you're questioning the order of the retval assignment, and the
> popped array?
>
> >> >$a = array_pop($a);
> >> >print_r($a);
>
> change that $b = array_pop($a);
> print_r($b);
> and I think you'll see what you expected to see.

Oh, I was really idiot on that, $a is assigned by reference. Sorry, too
much strings :)

Tomas V.V.Cox

-- 
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>