1--TEST--
2Test closedir() function : error conditions - Pass incorrect number of arguments
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 * Pass incorrect number of arguments to closedir() to test behaviour
19 */
20
21echo "*** Testing closedir() : error conditions ***\n";
22
23
24//Test closedir with one more than the expected number of arguments
25echo "\n-- Testing closedir() function with more than expected no. of arguments --\n";
26
27$dir_path = __DIR__ . '\私はガラスを食べられますclosedir_error';
28mkdir($dir_path);
29$dir_handle = opendir($dir_path);
30
31$extra_arg = 10;
32var_dump( closedir($dir_handle, $extra_arg) );
33
34//successfully close the directory handle so can delete in CLEAN section
35closedir($dir_handle);
36?>
37===DONE===
38--CLEAN--
39<?php
40$base_dir = __DIR__;
41$dir_path = $base_dir . '\私はガラスを食べられますclosedir_error';
42rmdir($dir_path);
43?>
44--EXPECTF--
45*** Testing closedir() : error conditions ***
46
47-- Testing closedir() function with more than expected no. of arguments --
48
49Warning: closedir() expects at most 1 parameter, 2 given in %s on line %d
50NULL
51===DONE===
52