mirror of
https://github.com/php/php-src.git
synced 2026-03-30 20:22:36 +02:00
Currently when you use RecursiveDirectoryIterator with the CURRENT_AS_PATHNAME flag PHP will throw an UnexpectedValueException with message 'Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator'.This happend because getChildren() will return the current directory name instead of an Iterator (or subclass of) as required by the RecursiveIterator interface. This commit changes getChildren() to return annother RecursiveDirectoryIterator but current() still returns the path name when CURRENT_AS_PATHNAME is used. A PHPT test case (bug66405.phpt) that reproduces the bug is included. This fix was originally against the PHP-5.4 branch, but it was not merged before 5.4 reached EOL. I am hoping to get it applied to 5.5, 5.6, and master.
This is an extension that aims to implement some efficient data access interfaces and classes. You'll find the classes documented using php code in the file spl.php or in the corresponding .inc file in the examples subdirectory. Based on the internal implementations or the files in the examples subdirectory there are also some .php files to experiment with. For more information look at: http://php.net/manual/en/book.spl.php