|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-10 11:28 UTC] tony2001@php.net
[2005-06-18 01:00 UTC] php-bugs at lists dot php dot net
[2005-08-13 11:44 UTC] ondrej at sury dot org
[2005-08-13 13:37 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
Description: ------------ This is a repost of 33264 33264 was closed because it was said the bug is the same as 31114. They are however completly different. 31114 is about foreach where the $key and $value are the same: foreach ($array AS $key => $key) which should, perhaps issue a warning. However, 33264 is about foreach not issuing an error when you try and loop on an unset variable or a string e.g.: $array = ''; foreach ($array AS $value) { this should, and used to issue an error (I think it was fatal). It not longer does. The manual even suggests this error is not preventable with a @, but not it dosen't appear at all. So this is both a real bug and important. Reproduce code: --------------- <?php error_reporting(E_ALL); foreach ($a AS $b) { } ?> Expected result: ---------------- Error about $a not being an array. Actual result: -------------- No error.