Re: [PHP-DEV] RE: PHP 4.0 Bug #8106 Updated: array_pop problem when using against an array returned from a class From: Andi Gutmans (andi <email protected>)
Date: 12/07/00

I think array_pop() returns NULL to indicate it has no further elements.
This is just in case you are saving bool() values in the array. It makes
more sense.

Andi

At 03:23 AM 12/7/00 +0200, Jani Taskinen wrote:
>On Wed, 6 Dec 2000, Andi Gutmans wrote:
>
> >At 01:17 AM 12/6/00 +0200, Jani Taskinen wrote:
> >>
> >> >> $number = array_pop($output);
> >>
> >>Does anyone (php-dev) have any objections to not to
> >>make array_pop() return FALSE on this error?
> >>(when the $output is not an array)
> >>
> >>Or am I missing something here?
> >
> >Can you explain the problem?
> >I missed it somehow :)
>
><?php
>
>$test = array();
>$ret =  <email protected>($test);
>var_dump($ret);
>if($ret === FALSE) echo "Error..";
>
>echo "<br>";
>
>$test = "abc";
>$ret =  <email protected>($test);
>var_dump($ret);
>if($ret === FALSE) echo "Error..";
>
>?>
>
>Now this prints:
>
>NULL
>NULL
>
>And which I think it should print:
>
>NULL
>bool(false) Error..
>
>--Jani
>
>

---
Andi Gutmans <andi <email protected>>
http://www.zend.com/

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