ID:               49607
 User updated by:  david at grudl dot com
 Reported By:      david at grudl dot com
 Status:           Bogus
 Bug Type:         SPL related
 Operating System: *
 PHP Version:      5.3.0
 New Comment:

Please open this bug, it is something different to 49608. This bug is 
not about crash, it is about incorrect iteration results.


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

[2009-11-30 20:07:03] j...@php.net

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #49608

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

[2009-09-20 14:18:15] david at grudl dot com

Description:
------------
Iteration over CachingIterator with DirectoryIterator leads to
incorrect results.


Reproduce code:
---------------
// w/o CachingIterator
$dir = new DirectoryIterator(dirname(__FILE__));
foreach ($dir as $val) {
        echo $val;
}

// with CachingIterator
$iterator = new CachingIterator($dir);
foreach ($iterator as $val) {
        echo $val;
}



Expected result:
----------------
It is expected the both code snippets produces the same result:

.
..
anyfile.php

Actual result:
--------------
// w/o CachingIterator:
.
..
anyfile.php

// with CachingIterator:
..
anyfile.php
(empty string)


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


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

Reply via email to