|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2003-07-22 12:25 UTC] derick@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
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