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/* Prototype  : void closedir([resource $dir_handle])
12 * Description: Close directory connection identified by the dir_handle
13 * Source code: ext/standard/dir.c
14 * Alias to functions: close
15 */
16
17/*
18 * Test basic functionality of closedir()
19 */
20
21echo "*** Testing closedir() : basic functionality ***\n";
22
23$base_dir = dirname(__FILE__);
24$dir_path = $base_dir . '/私はガラスを食べられますclosedir_basic';
25mkdir($dir_path);
26
27echo "\n-- Call closedir() with no arguments: --\n";
28$dh1 = opendir($dir_path);
29var_dump(closedir());
30echo "-- Check Directory Handle: --\n";
31var_dump($dh1);
32
33echo "\n-- Call closedir() with \$dir_handle argument supplied: --\n";
34$dh2 = opendir($dir_path);
35
36if ((int)$dh1 === (int)$dh2) {
37	echo "\nNo new resource created\n";
38}
39var_dump(closedir($dh2));
40echo "-- Check Directory Handle: --\n";
41var_dump($dh2);
42?>
43===DONE===
44--CLEAN--
45<?php
46$base_dir = dirname(__FILE__);
47$dir_path = $base_dir . '/私はガラスを食べられますclosedir_basic';
48rmdir($dir_path);
49?>
50--EXPECTF--
51*** Testing closedir() : basic functionality ***
52
53-- Call closedir() with no arguments: --
54NULL
55-- Check Directory Handle: --
56resource(%d) of type (Unknown)
57
58-- Call closedir() with $dir_handle argument supplied: --
59NULL
60-- Check Directory Handle: --
61resource(%d) of type (Unknown)
62===DONE===
63