1--TEST-- 2Test ctype_punct() function : error conditions - incorrect number of args 3--SKIPIF-- 4<?php require_once('skipif.inc'); ?> 5--FILE-- 6<?php 7/* Prototype : bool ctype_punct(mixed $c) 8 * Description: Checks for any printable character which is not whitespace 9 * or an alphanumeric character 10 * Source code: ext/ctype/ctype.c 11 */ 12 13/* 14 * Pass incorrect number of arguments to ctype_punct() to test behaviour 15 */ 16 17echo "*** Testing ctype_punct() : error conditions ***\n"; 18 19$orig = setlocale(LC_CTYPE, "C"); 20 21// Zero arguments 22echo "\n-- Testing ctype_punct() function with Zero arguments --\n"; 23var_dump( ctype_punct() ); 24 25//Test ctype_punct with one more than the expected number of arguments 26echo "\n-- Testing ctype_punct() function with more than expected no. of arguments --\n"; 27$c = 1; 28$extra_arg = 10; 29var_dump( ctype_punct($c, $extra_arg) ); 30 31setlocale(LC_CTYPE, $orig); 32?> 33===DONE=== 34--EXPECTF-- 35*** Testing ctype_punct() : error conditions *** 36 37-- Testing ctype_punct() function with Zero arguments -- 38 39Warning: ctype_punct() expects exactly 1 parameter, 0 given in %s on line %d 40NULL 41 42-- Testing ctype_punct() function with more than expected no. of arguments -- 43 44Warning: ctype_punct() expects exactly 1 parameter, 2 given in %s on line %d 45NULL 46===DONE=== 47