Annotation of embedaddon/php/ext/ereg/tests/split_variation_004.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test split() function : usage variations  - out-of-range values for limit
                      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: function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
                     12:        echo "Error: $err_no - $err_msg, $filename($linenum)\n";
                     13: }
                     14: set_error_handler('test_error_handler');
                     15: echo "*** Testing split() : usage variations ***\n";
                     16: 
                     17: $pattern = '[[:space:]]';
                     18: $string = '1 2 3 4 5';
                     19: var_dump(split($pattern, $string, 0));
                     20: var_dump(split($pattern, $string, -10));
                     21: var_dump(split($pattern, $string, 10E20));
                     22: 
                     23: 
                     24: echo "Done";
                     25: ?>
                     26: --EXPECTF--
                     27: *** Testing split() : usage variations ***
                     28: Error: 8192 - Function split() is deprecated, %s(16)
                     29: array(1) {
                     30:   [0]=>
                     31:   string(9) "1 2 3 4 5"
                     32: }
                     33: Error: 8192 - Function split() is deprecated, %s(17)
                     34: array(1) {
                     35:   [0]=>
                     36:   string(9) "1 2 3 4 5"
                     37: }
                     38: Error: 8192 - Function split() is deprecated, %s(18)
                     39: array(1) {
                     40:   [0]=>
                     41:   string(9) "1 2 3 4 5"
                     42: }
                     43: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>