#44018 [Asn->WFx]: RecursiveDirectoryIterator options inconsistancy
| From: | colder@php.net | Date: | Wed, 29 Oct 2008 22:38:38 +0000 |
| Subject: | #44018 [Asn->WFx]: RecursiveDirectoryIterator options inconsistancy | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-130294@lists.php.net to get a copy of this message | ||
ID: 44018
Updated by: colder@php.net
Reported By: jordan dot raub at dataxltd dot com
-Status: Assigned
+Status: Wont fix
Bug Type: SPL related
Operating System: *
PHP Version: 5.3.0alpha2
Assigned To: colder
New Comment:
After discussing with Marcus, it seems like the current solution is the
one that makes sense.
So even if it's a bit inconsistent with other iterators, or breaks with
older versions, it seems like it's better than changing it back.
Previous Comments:
------------------------------------------------------------------------
[2008-10-21 12:04:18] jani@php.net
Seems to be continuous regression? :)
------------------------------------------------------------------------
[2008-10-08 20:21:38] jordan dot raub at dataxltd dot com
The bug was reintroduced.
$obj = new RecursiveDirectoryIterator(dirname(__FILE__), 0);
$obj->current(); //should return a RecursiveDirectoryIterator
$obj = new RecursiveDirectoryIterator(dirname(__FILE__));
$obj->current(); //should return a RecursiveDirectoryIterator
both of these return SplFileObjects.
So it looks like CURRENT_AS_FILEINFO and CURRENT_AS_SELF should be
switched. CURRENT_AS_SELF === 0?
------------------------------------------------------------------------
[2008-10-08 19:41:22] colder@php.net
Using a test script testing some possibilities, I get such results:
Format is ($options) $key => type($val) when foreach'ing a
RecursiveDirectoryIterator with the following options.
Default:
() /home/colder/cvs/php5.2/ext/spl/doxygen.cfg =>SplFileInfo
Options = 0:
(0) /home/colder/cvs/php5.2/ext/spl/doxygen.cfg =>SplFileInfo
Options = CURRENT_AS_FILEINFO:
(0) /home/colder/cvs/php5.2/ext/spl/doxygen.cfg =>SplFileInfo
Options = CURRENT_AS_SELF:
(16) /home/colder/cvs/php5.2/ext/spl/doxygen.cfg
=>RecursiveDirectoryIterator
Options = CURRENT_AS_PATHNAME:
(32) /home/colder/cvs/php5.2/ext/spl/doxygen.cfg =>(string)
/home/colder/cvs/php5.2/ext/spl/doxygen.cfg
Options = KEY_AS_FILENAME:
(256) doxygen.cfg =>SplFileInfo
Options = KEY_AS_FILENAME|CURRENT_AS_FILEINFO:
(256) doxygen.cfg =>SplFileInfo
Options = NEW_CURRENT_AND_KEY:
(256) doxygen.cfg =>SplFileInfo
Options = KEY_MODE_MASK:
(3840) /home/colder/cvs/php5.2/ext/spl/doxygen.cfg =>SplFileInfo
This is consistent across 5.2, 5.3 and HEAD, and looks consistent to
me.
Where is the actual problem? Is it a regression? Documentation problem?
------------------------------------------------------------------------
[2008-10-08 18:17:26] jani@php.net
Assigned to the maintainer..
------------------------------------------------------------------------
[2008-10-03 16:32:10] jordan dot raub at dataxltd dot com
this also got reintroduced to 5.3, tests fail w/ 5.3alpha2
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/44018
--
Edit this bug report at http://bugs.php.net/?id=44018&edit=1