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