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