summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/bug24482.phpt
blob: f545f1addfd54def3fb1a99428430a007f0c5e06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--TEST--
Bug #24482 (GLOB_ONLYDIR not working)
--SKIPIF--
<?php
if (!function_exists("glob")) {
    die('skip glob() not available');
}
?>
--FILE--
<?php
$globdirs = glob("*", GLOB_ONLYDIR);

$dirs = array();
$dh = opendir(".");
while (is_string($file = readdir($dh))) {
	if ($file[0] === ".") continue;
	if (!is_dir($file)) continue;
	$dirs[] = $file;
}
closedir($dh);

if (count($dirs) != count($globdirs)) {
	echo "Directory count mismatch\n";
	
	echo "glob found:\n";
	sort($globdirs);	
	var_dump($globdirs);
	
	echo "opendir/readdir/isdir found:\n";
	sort($dirs);	
	var_dump($dirs);
} else {
	echo "OK\n";
}
?>
--EXPECT--
OK