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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cmoore at iyd dot com
New email:
PHP Version: OS:

 

 [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: Fri Apr 26 20:01:29 2024 UTC