xref: /PHP-8.3/ext/spl/tests/bug51068.phpt (revision f8d79582)
1--TEST--
2SPL: glob wrapper interactions with DirectoryIterator
3--FILE--
4<?php
5touch('bug.51068');
6mkdir('bug.51068.dir');
7touch('bug.51068.dir/lvl2.bug.51068');
8$iter = new DirectoryIterator('glob://*.51068');
9foreach ($iter as $f) {
10    var_dump($f->getFilename());
11    var_dump($f->getSize());
12}
13$iter = new DirectoryIterator('glob://bug.51068.dir/*.51068');
14foreach ($iter as $f) {
15  var_dump($f->getFilename());
16  var_dump($f->getSize());
17}
18$iter = new DirectoryIterator('glob://bug.51068.dir');
19foreach ($iter as $f) {
20  var_dump($f->getFilename());
21  var_dump($f->getSize() >= 0);
22}
23?>
24--CLEAN--
25<?php
26unlink('bug.51068');
27unlink('bug.51068.dir/lvl2.bug.51068');
28rmdir('bug.51068.dir');
29?>
30--EXPECT--
31string(9) "bug.51068"
32int(0)
33string(14) "lvl2.bug.51068"
34int(0)
35string(13) "bug.51068.dir"
36bool(true)
37