#24754 [NEW]: each() seems to return BOOL instead of ARRAY

From: Date: Tue, 22 Jul 2003 17:20:08 +0000
Subject: #24754 [NEW]: each() seems to return BOOL instead of ARRAY
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-44521@lists.php.net to get a copy of this message
From: web at developer dot bg Operating system: Windows2000 Adv Server PHP version: 4.3.2 PHP Bug Type: Unknown/Other Function Bug description: each() seems to return BOOL instead of ARRAY Description: ------------ Under certain circumstances a variable storing the result of each() contains the boolean TRUE instead of the array or FALSE that is normaly expected. The code will give you an idea what exactly is the problem. Reproduce code: --------------- $arr = array('apple', 'banana', 'strawberry', 'pineapple', 'orange'); $i = 0; while($fruit=each($arr) || $i>=3) { echo $fruit[value].'<br>'; $i++; } Expected result: ---------------- apple banana strawberry Actual result: -------------- 1 1 1 -- Edit bug report at http://bugs.php.net/?id=24754&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24754&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24754&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24754&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24754&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24754&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24754&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24754&r=support Expected behavior: http://bugs.php.net/fix.php?id=24754&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24754&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24754&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24754&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24754&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24754&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24754&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24754&r=gnused

« previous php.bugs (#44521) next »