Edit report at https://bugs.php.net/bug.php?id=60742&edit=1
ID: 60742 Comment by: jthijssen at noxlogic dot nl Reported by: jthijssen at noxlogic dot nl Summary: FilesystemIterator::OTHER_MODE_MASK Status: Assigned Type: Feature/Change Request Package: SPL related PHP Version: 5.4.0RC5 Assigned To: colder Block user comment: N Private report: N New Comment: Pull request merged by dsp_ into the git 5.4 branch: https://github.com/php/php-src/pull/5 Previous Comments: ------------------------------------------------------------------------ [2012-01-13 12:44:46] 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' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60742&edit=1