1--TEST--
2Test closedir() function : basic functionality
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) != 'WIN') {
6  die("skip Valid only on Windows");
7}
8?>
9--FILE--
10<?php
11/*
12 * Test basic functionality of closedir()
13 */
14
15echo "*** Testing closedir() : basic functionality ***\n";
16
17$base_dir = __DIR__;
18$dir_path = $base_dir . '/私はガラスを食べられますclosedir_basic';
19mkdir($dir_path);
20
21echo "\n-- Call closedir() with no arguments: --\n";
22$dh1 = opendir($dir_path);
23var_dump(closedir());
24echo "-- Check Directory Handle: --\n";
25var_dump($dh1);
26
27echo "\n-- Call closedir() with \$dir_handle argument supplied: --\n";
28$dh2 = opendir($dir_path);
29
30if ((int)$dh1 === (int)$dh2) {
31    echo "\nNo new resource created\n";
32}
33var_dump(closedir($dh2));
34echo "-- Check Directory Handle: --\n";
35var_dump($dh2);
36?>
37--CLEAN--
38<?php
39$base_dir = __DIR__;
40$dir_path = $base_dir . '/私はガラスを食べられますclosedir_basic';
41rmdir($dir_path);
42?>
43--EXPECTF--
44*** Testing closedir() : basic functionality ***
45
46-- Call closedir() with no arguments: --
47NULL
48-- Check Directory Handle: --
49resource(%d) of type (Unknown)
50
51-- Call closedir() with $dir_handle argument supplied: --
52NULL
53-- Check Directory Handle: --
54resource(%d) of type (Unknown)
55