From: Operating system: GNU/Linux PHP version: 5.3SVN-2012-01-17 (SVN) Package: *Directory/Filesystem functions Bug Type: Bug Bug description:FilesystemIterator always uses SPL_FILE_DIR_SKIPDOTS
Description: ------------ The documentation of FilesystemIterator::__construct() (http://de.php.net/manual/en/filesystemiterator.construct.php) suggests that it is possible to use arbitrary valid flags for the iterator. I do not fully understand the PHP source, but⦠/* {{{ proto void FilesystemIterator::__construct(string path [, int flags]) Cronstructs a new dir iterator from a path. */ SPL_METHOD(FilesystemIterator, __construct) { spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, DIT_CTOR_FLAGS | SPL_FILE_DIR_SKIPDOTS); } /* }}} */ The code above makes me believe that the flag SPL_FILE_DIR_SKIPDOTS is *always* added to the flags when using the FilesystemIterator. So it is not possible to make the flag NOT be there, by for example using 0 as argument. So either this is a documentation issue, or this is an implementation bug. Test script: --------------- <?php $oDirectoryIt = new FilesystemIterator('.', 0); $oDirectoryIt->setFlags(0); foreach ($oDirectoryIt as $oDirectory) { var_dump($oDirectory); } ?> Expected result: ---------------- I expect to see "." and ".." in the output. Actual result: -------------- I do not see "." or "..". -- Edit bug report at https://bugs.php.net/bug.php?id=60776&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60776&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60776&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60776&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60776&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60776&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60776&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60776&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60776&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60776&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60776&r=support Expected behavior: https://bugs.php.net/fix.php?id=60776&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60776&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60776&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60776&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60776&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60776&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60776&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60776&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60776&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60776&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60776&r=mysqlcfg
