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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
19 + 13 = ?
Subscribe to this entry?

 
 [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: Wed May 01 02:01:31 2024 UTC