php-src/ext/spl/tests/bug62433.phpt

19 lines
626 B
Plaintext
Raw Normal View History

--TEST--
Bug #62433 Inconsistent behavior of RecursiveDirectoryIterator to dot files (. and ..)
--FILE--
<?php
$dots = array_keys(iterator_to_array(new RecursiveDirectoryIterator(__DIR__)));
$ndots = array_keys(iterator_to_array(new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS)));
2012-07-09 10:42:10 +00:00
var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '.', $dots));
var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '..', $dots));
2012-07-09 10:42:10 +00:00
var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '.', $ndots));
var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '..', $ndots));
?>
--EXPECT--
bool(true)
bool(true)
bool(false)
bool(false)