1--TEST-- 2Test spliti() function : error conditions - wrong number of args 3--FILE-- 4<?php 5/* Prototype : proto array spliti(string pattern, string string [, int limit]) 6 * Description: spliti string into array by regular expression 7 * Source code: ext/standard/reg.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing spliti() : error conditions - wrong number of args ***\n"; 12 13 14//Test spliti with one more than the expected number of arguments 15echo "\n-- Testing spliti() function with more than expected no. of arguments --\n"; 16$pattern = 'string_val'; 17$string = 'string_val'; 18$limit = 10; 19$extra_arg = 10; 20var_dump( spliti($pattern, $string, $limit, $extra_arg) ); 21 22// Testing spliti with one less than the expected number of arguments 23echo "\n-- Testing spliti() function with less than expected no. of arguments --\n"; 24$pattern = 'string_val'; 25var_dump( spliti($pattern) ); 26 27echo "Done"; 28?> 29--EXPECTF-- 30*** Testing spliti() : error conditions - wrong number of args *** 31 32-- Testing spliti() function with more than expected no. of arguments -- 33 34Deprecated: Function spliti() is deprecated in %s on line %d 35 36Warning: spliti() expects at most 3 parameters, 4 given in %s on line %d 37NULL 38 39-- Testing spliti() function with less than expected no. of arguments -- 40 41Deprecated: Function spliti() is deprecated in %s on line %d 42 43Warning: spliti() expects at least 2 parameters, 1 given in %s on line %d 44NULL 45Done 46