1--TEST--
2Test closedir() function : error conditions - Pass incorrect number of arguments
3--FILE--
4<?php
5/* Prototype  : void closedir([resource $dir_handle])
6 * Description: Close directory connection identified by the dir_handle
7 * Source code: ext/standard/dir.c
8 * Alias to functions: close
9 */
10
11/*
12 * Pass incorrect number of arguments to closedir() to test behaviour
13 */
14
15echo "*** Testing closedir() : error conditions ***\n";
16
17
18//Test closedir with one more than the expected number of arguments
19echo "\n-- Testing closedir() function with more than expected no. of arguments --\n";
20
21$dir_path = dirname(__FILE__) . '\closedir_error';
22mkdir($dir_path);
23$dir_handle = opendir($dir_path);
24
25$extra_arg = 10;
26var_dump( closedir($dir_handle, $extra_arg) );
27
28//successfully close the directory handle so can delete in CLEAN section
29closedir($dir_handle);
30?>
31===DONE===
32--CLEAN--
33<?php
34$base_dir = dirname(__FILE__);
35$dir_path = $base_dir . '\closedir_error';
36rmdir($dir_path);
37?>
38--EXPECTF--
39*** Testing closedir() : error conditions ***
40
41-- Testing closedir() function with more than expected no. of arguments --
42
43Warning: closedir() expects at most 1 parameter, 2 given in %s on line %d
44NULL
45===DONE===
46