/hphp/test/slow/ext_file/readdir.php
http://github.com/facebook/hiphop-php · PHP · 37 lines · 29 code · 8 blank · 0 comment · 11 complexity · 95bc76803d351ddb926c84f6a75f66ce MD5 · raw file
- <?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);
- }
- }
- }