ID:               36132
 Updated by:       [EMAIL PROTECTED]
 Reported By:      quick_defect at yahoo dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         SPL related
 Operating System: redhat
 PHP Version:      5.1.2
-Assigned To:      
+Assigned To:      helly
 New Comment:

Assigned to the maintainer.


Previous Comments:
------------------------------------------------------------------------

[2006-01-23 09:51:11] quick_defect at yahoo dot com

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"



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36132&edit=1

Reply via email to