1--TEST--
2Test rewinddir() function : error conditions - incorrect number of args
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 rewinddir([resource $dir_handle])
12 * Description: Rewind dir_handle back to the start
13 * Source code: ext/standard/dir.c
14 * Alias to functions: rewind
15 */
16
17/*
18 * Pass incorrect number of arguments to rewinddir() to test behaviour
19 */
20
21echo "*** Testing rewinddir() : error conditions ***\n";
22
23
24//Test rewinddir with one more than the expected number of arguments
25echo "\n-- Testing rewinddir() function with more than expected no. of arguments --\n";
26
27$dir_path = dirname(__FILE__) . "/私はガラスを食べられますrewinddir_error";
28mkdir($dir_path);
29$dir_handle = opendir($dir_path);
30$extra_arg = 10;
31
32var_dump( rewinddir($dir_handle, $extra_arg) );
33closedir($dir_handle);
34?>
35===DONE===
36--CLEAN--
37<?php
38$dir_path = dirname(__FILE__) . "/私はガラスを食べられますrewinddir_error";
39rmdir($dir_path);
40?>
41--EXPECTF--
42*** Testing rewinddir() : error conditions ***
43
44-- Testing rewinddir() function with more than expected no. of arguments --
45
46Warning: rewinddir() expects at most 1 parameter, 2 given in %s on line %d
47NULL
48===DONE===
49