|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60742 FilesystemIterator::OTHER_MODE_MASK
Submitted: 2012-01-13 12:44 UTC Modified: 2012-03-19 22:47 UTC
From: jthijssen at noxlogic dot nl Assigned: dsp (profile)
Status: Closed Package: SPL related
PHP Version: 5.4.0RC5 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jthijssen at noxlogic dot nl
New email:
PHP Version: OS:


 [2012-01-13 12:44 UTC] jthijssen at noxlogic dot nl
The FileSystemIterator defines a few constants to mask its flags: CURRENT_MODE_MASK and KEY_MODE_MASK. However, there are other flags (SKIP_DOTS and UNIX_PATHS) which cannot be masked of by a constant. 

However, internally, there is a mask constant defined (SPL_FILE_DIR_OTHERS_MASK). It makes sense that this value is also known in PHP userland by the OTHER_MODE_MASK constant.

The attached patch adds this constant and is compatible with trunk, php_5_4 and php_5_3 branches.

Test script:
$it = new fileSystemIterator(".", FileSystemIterator::SKIP_DOTS | FileSystemIterator::CURRENT_AS_SELF);
$masked_flags = ($it->getFlags() & FileSystemIterator::OTHER_MODE_MASK);
print $masked_flags;

Expected result:

Actual result:
PHP Notice:  Use of undefined constant OTHER_MODE_MASK - assumed 'OTHER_MODE_MASK' 


othermask.patch (last revision 2012-01-13 12:44 UTC by jthijssen at noxlogic dot nl)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-04 16:10 UTC]
-Assigned To: +Assigned To: colder
 [2012-03-19 21:39 UTC] jthijssen at noxlogic dot nl
Pull request merged by dsp_ into the git 5.4 branch:
 [2012-03-19 22:47 UTC]
-Status: Assigned +Status: Closed -Assigned To: colder +Assigned To: dsp
 [2012-03-19 22:47 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

(sorry for the outdated message above ;-) )
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 21 05:03:38 2023 UTC