php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jthijssen at noxlogic dot nl
New email:
PHP Version: OS:

 

 [2012-01-13 12:44 UTC] jthijssen at noxlogic dot nl
Description:
------------
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:
---------------
<?php
$it = new fileSystemIterator(".", FileSystemIterator::SKIP_DOTS | FileSystemIterator::CURRENT_AS_SELF);
$masked_flags = ($it->getFlags() & FileSystemIterator::OTHER_MODE_MASK);
print $masked_flags;

Expected result:
----------------
4096

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

Patches

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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-04 16:10 UTC] colder@php.net
-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:

https://github.com/php/php-src/pull/5
 [2012-03-19 22:47 UTC] johannes@php.net
-Status: Assigned +Status: Closed -Assigned To: colder +Assigned To: dsp
 [2012-03-19 22:47 UTC] johannes@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

(sorry for the outdated message above ;-) )
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 04:01:27 2025 UTC