ID: 49607
Updated by: [email protected]
Reported By: david at grudl dot com
-Status: Open
+Status: Bogus
Bug Type: SPL related
Operating System: *
PHP Version: 5.3.0
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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