note 61555 added to function.next

From: Date: Mon, 06 Feb 2006 21:27:35 +0000
Subject: note 61555 added to function.next
Groups: php.notes 
Request: Send a blank email to php-notes+get-103139@lists.php.net to get a copy of this message
be careful when using the return value of 'next()' in a while or do-while loop. The following loop will exit before it can go through all elements of the array... <? $testArray = array( "a" => "apple", "b" => false, "c" => "cat" ); do { echo(key($testArray)."\n"); } while (next($testArray)); ?> ---- Server IP: 64.71.164.2 Probable Submitter: 64.84.9.2 ---- Manual Page -- http://www.php.net/manual/en/function.next.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61555 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61555&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61555&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61555&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61555&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61555&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61555&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61555&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61555&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103139) next »