1--TEST-- 2Test count_chars() function : error conditions 3--FILE-- 4<?php 5 6/* Prototype : mixed count_chars ( string $string [, int $mode ] ) 7 * Description: Return information about characters used in a string 8 * Source code: ext/standard/string.c 9*/ 10 11echo "*** Testing count_chars() : error conditions ***\n"; 12 13echo "\n-- Testing count_chars() function with no arguments --\n"; 14var_dump( count_chars() ); 15 16echo "\n-- Testing count_chars() function with more than expected no. of arguments --\n"; 17$string = "Hello World\n"; 18$mode = 1; 19$extra_arg = 10; 20var_dump( count_chars($string, $mode, $extra_arg) ); 21 22?> 23===DONE=== 24--EXPECTF-- 25*** Testing count_chars() : error conditions *** 26 27-- Testing count_chars() function with no arguments -- 28 29Warning: count_chars() expects at least 1 parameter, 0 given in %s on line %d 30NULL 31 32-- Testing count_chars() function with more than expected no. of arguments -- 33 34Warning: count_chars() expects at most 2 parameters, 3 given in %s on line %d 35NULL 36===DONE=== 37