/hphp/test/slow/ext_file/readdir.php
PHP | 37 lines | 29 code | 8 blank | 0 comment | 11 complexity | 95bc76803d351ddb926c84f6a75f66ce MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- <<__EntryPoint>>
- function main_readdir() {
- $d = dir(__DIR__);
- while ($ent = readdir($d->handle)) {
- if ($ent == 'test_ext_file.txt') {
- var_dump($ent);
- }
- }
- closedir($d->handle);
- $d = opendir(__DIR__);
- while ($ent = readdir($d)) {
- if ($ent == 'test_ext_file.txt') {
- var_dump($ent);
- }
- }
- rewinddir($d);
- while ($ent = readdir($d)) {
- if ($ent == 'test_ext_file.txt') {
- var_dump($ent);
- }
- }
- closedir($d);
- foreach (scandir(__DIR__) as $x) {
- if ($x == 'test_ext_file.txt') {
- var_dump($x);
- }
- }
- }