|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-23 10:00 UTC] tony2001@php.net
[2006-01-23 10:08 UTC] helly@php.net
[2006-01-23 10:30 UTC] quick_defect at yahoo dot com
[2006-01-23 10:51 UTC] sniper@php.net
[2006-01-24 06:13 UTC] quick_defect at yahoo dot com
[2006-01-24 14:35 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 21:00:02 2025 UTC |
Description: ------------ I know I did not use the rewind function as usual. But after I did so, the behavior of Iterator seemed went wrong. Reproduce code: --------------- <?php $ary=array("1","2"); $ary_obj=new ArrayObject($ary); $ite=$ary_obj->getIterator(); $c_ite=new CachingIterator($ite); $ite->rewind(); $c_ite->rewind(); for($axx=$ite;$axx->valid();$axx->next()) { var_dump($axx->current()); } echo "*******\n"; $c_ite->rewind(); $ite->rewind(); for($axx=$c_ite;$axx->valid();$axx->next()) { var_dump($axx->current()); } ?> Expected result: ---------------- string(1) "1" string(1) "2" ******* string(1) "1" string(1) "2" Actual result: -------------- string(1) "2" ******* string(1) "1" string(1) "1" string(1) "2"