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