|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-06-12 16:45 UTC] jim at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jun 14 10:00:01 2026 UTC |
The following code snippet generates a nasty warning when $mylist is empty. while (list($key, $val) = each($mylist)) { // do warning } The workaround in PHP is trivial, but ugly. while (count($mylist) and list($key, $val) = each($mylist)) { // do warning } Would be nicer if the each() iterator just returned nothing, causing the while loop to terminate, when the list is empty.