PHP 4.0 Bug #6606 Updated: Crash when returning NULL as a reference value
| From: | sniper@php.net | Date: | Sun, 07 Jan 2001 23:42:14 +0000 |
| Subject: | PHP 4.0 Bug #6606 Updated: Crash when returning NULL as a reference value | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-43278@lists.php.net to get a copy of this message | ||
ID: 6606
Updated by: sniper
Reported By: gildas@stip.fr
Old-Status: Open
Status: Feedback
Bug Type: Reproduceable crash
Assigned To:
Comments:
Does this happen with PHP 4.0.4 ??
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-09-07 12:27:50] gildas@stip.fr
This crashes:
function &foo() {
while (list($key, $name) = each($arr));
return($ret);
}
------
This works:
function &foo() {
if (is_array($arr))
while (list($key, $name) = each($arr));
return($ret);
}
------
This works:
function &foo() {
while (list($key, $name) = each($arr));
return(is_array($ret) ? $ret : false);
}
I know returning a NULL value as refernce is nonsense but it shouldn't crash, right?
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6606