#49607 [Opn->Bgs]: CachingIterator & DirectoryIterator incorrect behaviour

From: Date: Mon, 30 Nov 2009 20:07:04 +0000
Subject: #49607 [Opn->Bgs]: CachingIterator & DirectoryIterator incorrect behaviour
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-145242@lists.php.net to get a copy of this message
ID: 49607 Updated by: jani@php.net 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

« previous php.bugs (#145242) next »