xref: /PHP-5.5/ext/spl/tests/bug62433.phpt (revision 2032470e)
1--TEST--
2Bug #62433 Inconsistent behavior of RecursiveDirectoryIterator to dot files (. and ..)
3--FILE--
4<?php
5$dots = array_keys(iterator_to_array(new RecursiveDirectoryIterator(__DIR__)));
6$ndots = array_keys(iterator_to_array(new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS)));
7
8var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '.', $dots));
9var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '..', $dots));
10
11var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '.', $ndots));
12var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '..', $ndots));
13?>
14--EXPECT--
15bool(true)
16bool(true)
17bool(false)
18bool(false)
19