Re: RE: PHP 4.0 Bug #8106 Updated: array_pop problem when using against an array returned from a class
| From: | Jani Taskinen | Date: | Thu, 07 Dec 2000 01:23:59 +0000 |
| Subject: | Re: RE: PHP 4.0 Bug #8106 Updated: array_pop problem when using against an array returned from a class | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-40282@lists.php.net to get a copy of this message | ||
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 = @array_pop($test);
var_dump($ret);
if($ret === FALSE) echo "Error..";
echo "<br>";
$test = "abc";
$ret = @array_pop($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