php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6606 Crash when returning NULL as a reference value
Submitted: 2000-09-07 12:27 UTC Modified: 2001-03-08 20:17 UTC
From: gildas at stip dot fr Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.2 OS: Windoze 98
Private report: No CVE-ID: None
 [2000-09-07 12:27 UTC] gildas at stip dot 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?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-07 18:42 UTC] sniper@php.net
Does this happen with PHP 4.0.4 ??

--Jani
 [2001-03-08 20:17 UTC] sniper@php.net
No feedback.
Doesn't crash for me with the latest CVS.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 05:01:30 2024 UTC