1--TEST-- 2Test dirname() function : error conditions 3--CREDITS-- 4Dave Kelsey <d_kelsey@uk.ibm.com> 5--FILE-- 6<?php 7/* Prototype : string dirname(string path) 8 * Description: Returns the directory name component of the path 9 * Source code: ext/standard/string.c 10 * Alias to functions: 11 */ 12 13echo "*** Testing dirname() : error conditions ***\n"; 14 15// Zero arguments 16echo "\n-- Testing dirname() function with Zero arguments --\n"; 17var_dump( dirname() ); 18 19//Test dirname with one more than the expected number of arguments 20echo "\n-- Testing dirname() function with more than expected no. of arguments --\n"; 21$path = 'string_val'; 22$extra_arg = 10; 23var_dump( dirname($path, 1, $extra_arg) ); 24 25?> 26===DONE=== 27--EXPECTF-- 28*** Testing dirname() : error conditions *** 29 30-- Testing dirname() function with Zero arguments -- 31 32Warning: dirname() expects at least 1 parameter, 0 given in %s on line %d 33NULL 34 35-- Testing dirname() function with more than expected no. of arguments -- 36 37Warning: dirname() expects at most 2 parameters, 3 given in %s on line %d 38NULL 39===DONE=== 40 41