php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32677 undefined variable defined after passed to foreach
Submitted: 2005-04-11 20:53 UTC Modified: 2005-04-11 23:09 UTC
From: cmoore at iyd dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.3.11 OS: Linux
Private report: No CVE-ID: None
 [2005-04-11 20:53 UTC] cmoore at iyd dot com
Description:
------------
after calling foreach on an undefined variable, you no longer get warnings about the variable being undefined with error_reporting(E_ALL).


Reproduce code:
---------------
<?
error_reporting(E_ALL);
if ($undefined)
 ;
foreach($undefined as $unimportant)
 ;
if ($undefined)
 ;


Expected result:
----------------
Notice: Undefined variable:  undefined in foreach.php on line 3
Notice: Undefined variable:  undefined in foreach.php on line 7


Actual result:
--------------
Notice: Undefined variable:  undefined in foreach.php on line 3


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-11 23:09 UTC] sniper@php.net
Yes, one report is enough about this..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 10:01:28 2024 UTC