mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

FilesystemIterator::FOLLOW_SYMLINKS is currently treated as a directory key mode flag, even though it does not change the way that the key during iteration is set. To address this, FOLLOW_SYMLINKS has been converted into an OTHER flag. Closes GH-6695.
40 lines
840 B
PHP
40 lines
840 B
PHP
--TEST--
|
|
SPL: FilesystemIterator::getFlags() basic tests
|
|
--CREDITS--
|
|
Joshua Thijssen <jthijssen@noxlogic.nl>
|
|
--FILE--
|
|
<?php
|
|
|
|
$it = new FileSystemIterator(".");
|
|
printflags($it);
|
|
|
|
$it->setFlags(FileSystemIterator::CURRENT_AS_SELF |
|
|
FileSystemIterator::KEY_AS_FILENAME |
|
|
FileSystemIterator::SKIP_DOTS |
|
|
FileSystemIterator::UNIX_PATHS);
|
|
printflags($it);
|
|
|
|
$it->setFlags(-1);
|
|
printflags($it);
|
|
|
|
function printflags($it) {
|
|
printf("%08X\n", $it->getFlags());
|
|
printf("%08X\n", ($it->getFlags() & FileSystemIterator::CURRENT_MODE_MASK));
|
|
printf("%08X\n", ($it->getFlags() & FileSystemIterator::KEY_MODE_MASK));
|
|
printf("%08X\n", ($it->getFlags() & FileSystemIterator::OTHER_MODE_MASK));
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
00001000
|
|
00000000
|
|
00000000
|
|
00001000
|
|
00003110
|
|
00000010
|
|
00000100
|
|
00003000
|
|
00007FF0
|
|
000000F0
|
|
00000F00
|
|
00007000
|