foreach sets source variable if not already set and does not issue warning
| Bug #32670 | foreach sets source variable if not already set and does not issue warning | ||||
|---|---|---|---|---|---|
| Submitted: | 2005-04-11 16:07 UTC | Modified: | 2005-05-03 03:30 UTC | ||
| From: | cmoore at iyd dot com | Assigned: | |||
| Status: | Closed | Package: | Arrays related | ||
| PHP Version: | 4CVS, 5CVS (2005-04-11) | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2005-04-11 16:07 UTC] cmoore at iyd dot com
Description: ------------ prior versions of php (4.3.10 tested) will issue a warning if an unset variable is passed to foreach(). even with error_reporting(E_ALL), this one will not warn. the warning would be nice to see with the same level of error reporting that if() warns at. Reproduce code: --------------- <? error_reporting(E_ALL); foreach($check as $test) ; Expected result: ---------------- Warning: Invalid argument supplied for foreach() in test.php on line 3 Actual result: -------------- there is no result in 4.3.11
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-04-11 17:36 UTC] sniper@php.net
[2005-05-03 03:30 UTC] iliaa@php.net