PHP 4.0 Bug #6606: Crash when returning NULL as a reference value

From: Date: Thu, 07 Sep 2000 16:27:50 +0000
Subject: PHP 4.0 Bug #6606: Crash when returning NULL as a reference value
Groups: php.dev 
Request: Send a blank email to php-dev+get-32576@lists.php.net to get a copy of this message
From: gildas@stip.fr Operating system: Windoze 98 PHP version: 4.0.2 PHP Bug Type: Reproduceable crash Bug description: Crash when returning NULL as a reference value 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?

« previous php.dev (#32576) next »