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
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: 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

Pull Requests

History

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

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 06:01:34 2025 UTC