Bug #49607 [Nab->ReO]: CachingIterator & DirectoryIterator incorrect behaviour
Edit report at https://bugs.php.net/bug.php?id=49607&edit=1
ID: 49607
Updated by: vrana@php.net
Reported by: david at grudl dot com
Summary: CachingIterator & DirectoryIterator incorrect
behaviour
-Status: Not a bug
+Status: Re-Opened
Type: Bug
Package: SPL related
Operating System: *
PHP Version: 5.3.0
Block user comment: N
Private report: N
New Comment:
This is still not fixed.
Previous Comments:
------------------------------------------------------------------------
[2009-12-01 13:17:23] david at grudl dot com
Please open this bug, it is something different to 49608. This bug is
not about crash, it is about incorrect iteration results.
------------------------------------------------------------------------
[2009-11-30 20:07:03] jani@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 https://bugs.php.net/bug.php?id=49607&edit=1
Thread (4 messages)