Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / ereg / tests / eregi_replace_error_001.phpt
blobff94833555e2e95d40d4bd23c7cd49655ad6223e
1 --TEST--
2 Test eregi_replace() function : error conditions - wrong number of args
3 --FILE--
4 <?php
5 /* Prototype  : proto string eregi_replace(string pattern, string replacement, string string)
6  * Description: Replace regular expression 
7  * Source code: ext/standard/reg.c
8  * Alias to functions: 
9  */
11 echo "*** Testing eregi_replace() : error conditions ***\n";
14 //Test eregi_replace with one more than the expected number of arguments
15 echo "\n-- Testing eregi_replace() function with more than expected no. of arguments --\n";
16 $pattern = 'string_val';
17 $replacement = 'string_val';
18 $string = 'string_val';
19 $extra_arg = 10;
20 var_dump( eregi_replace($pattern, $replacement, $string, $extra_arg) );
22 // Testing eregi_replace with one less than the expected number of arguments
23 echo "\n-- Testing eregi_replace() function with less than expected no. of arguments --\n";
24 $pattern = 'string_val';
25 $replacement = 'string_val';
26 var_dump( eregi_replace($pattern, $replacement) );
28 echo "Done";
30 --EXPECTF--
31 *** Testing eregi_replace() : error conditions ***
33 -- Testing eregi_replace() function with more than expected no. of arguments --
35 Deprecated: Function eregi_replace() is deprecated in %s on line %d
37 Warning: eregi_replace() expects exactly 3 parameters, 4 given in %s on line %d
38 NULL
40 -- Testing eregi_replace() function with less than expected no. of arguments --
42 Deprecated: Function eregi_replace() is deprecated in %s on line %d
44 Warning: eregi_replace() expects exactly 3 parameters, 2 given in %s on line %d
45 NULL
46 Done