|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-13 09:44 UTC] tony2001@php.net
[2010-07-29 16:13 UTC] dalonso at sistemio dot com
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 00:00:01 2025 UTC |
Description: ------------ there is a bug in 5.2.6 causing unexpected results when using next() function indisde foreach. Results from php 5.1, or 4.x are as expected. Reproduce code: --------------- <?php $arr=array('a','b','c', 'd','e'); foreach($arr as $a){ print_r($a); echo " next is: "; print_r(next($arr)); echo "<br />"; } ?> Expected result: ---------------- a next is: b b next is: c c next is: d d next is: e e next is: Actual result: -------------- a next is: c b next is: d c next is: e d next is: e next is: