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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gildas at stip dot fr
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Mar 15 14:01:29 2025 UTC