#32677 [NEW]: undefined variable defined after passed to foreach
| From: | cmoore at iyd dot com | Date: | Mon, 11 Apr 2005 18:53:04 +0000 |
| Subject: | #32677 [NEW]: undefined variable defined after passed to foreach | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-76728@lists.php.net to get a copy of this message | ||
From: cmoore at iyd dot com
Operating system: Linux
PHP version: 4.3.11
PHP Bug Type: Arrays related
Bug description: undefined variable defined after passed to foreach
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
--
Edit bug report at http://bugs.php.net/?id=32677&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32677&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32677&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32677&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32677&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32677&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32677&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32677&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32677&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32677&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32677&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32677&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32677&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32677&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32677&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32677&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32677&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32677&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32677&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32677&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32677&r=mysqlcfg