blob: 26b4a5b8b70f9f3b375db7d000e5668553195199 (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
--TEST--
Test closedir() function : usage variations - close directory handle twice
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
die("skip Valid only on Windows");
}
?>
--FILE--
<?php
/* Prototype : void closedir([resource $dir_handle])
* Description: Close directory connection identified by the dir_handle
* Source code: ext/standard/dir.c
* Alias to functions: close
*/
/*
* close the directory handle twice using closedir() to test behaviour
*/
echo "*** Testing closedir() : usage variations ***\n";
//create temporary directory for test, removed in CLEAN section
$directory = dirname(__FILE__) . "/私はガラスを食べられますclosedir_variation2";
mkdir($directory);
$dh = opendir($directory);
echo "\n-- Close directory handle first time: --\n";
var_dump(closedir($dh));
echo "Directory Handle: ";
var_dump($dh);
echo "\n-- Close directory handle second time: --\n";
var_dump(closedir($dh));
echo "Directory Handle: ";
var_dump($dh);
?>
===DONE===
--CLEAN--
<?php
$directory = dirname(__FILE__) . "/私はガラスを食べられますclosedir_variation2";
rmdir($directory);
?>
--EXPECTF--
*** Testing closedir() : usage variations ***
-- Close directory handle first time: --
NULL
Directory Handle: resource(%d) of type (Unknown)
-- Close directory handle second time: --
Warning: closedir(): %s is not a valid Directory resource in %s on line %d
bool(false)
Directory Handle: resource(%d) of type (Unknown)
===DONE===
|