|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60776 FilesystemIterator always uses SPL_FILE_DIR_SKIPDOTS
Submitted: 2012-01-17 12:01 UTC Modified: 2017-01-28 11:43 UTC
From: alex dot schuch at gmx dot de Assigned:
Status: Closed Package: SPL related
PHP Version: 5.3SVN-2012-01-17 (SVN) OS: GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
26 - 17 = ?
Subscribe to this entry?

 [2012-01-17 12:01 UTC] alex dot schuch at gmx dot de
The documentation of FilesystemIterator::__construct() ( 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)
/* }}} */

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:
$oDirectoryIt = new FilesystemIterator('.', 0);

foreach ($oDirectoryIt as $oDirectory) {

Expected result:
I expect to see "." and ".." in the output.

Actual result:
I do not see "." or "..".


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-12 16:34 UTC]
This is intended functionality, documentation should be updated to reflect that.
 [2012-03-12 16:34 UTC]
-Package: *Directory/Filesystem functions +Package: Documentation problem
 [2017-01-28 11:43 UTC]
-Type: Bug +Type: Documentation Problem -Package: Documentation problem +Package: SPL related
 [2020-11-18 12:28 UTC]
Automatic comment on behalf of cmb
Log: Fix #60776: FilesystemIterator always uses SPL_FILE_DIR_SKIPDOTS
 [2020-11-18 12:28 UTC]
-Status: Open +Status: Closed
 [2020-11-18 22:15 UTC]
Automatic comment on behalf of mumumu
Log: Fix #60776: FilesystemIterator always uses SPL_FILE_DIR_SKIPDOTS
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Dec 03 18:01:23 2020 UTC