Annotation of embedaddon/php/ext/standard/tests/array/array_splice_errors.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test array_splice() function : error conditions
                      3: --FILE--
                      4: <?php
                      5: /* 
                      6:  * proto array array_splice(array input, int offset [, int length [, array replacement]])
                      7:  * Function is implemented in ext/standard/array.c
                      8: */ 
                      9: 
                     10: echo "\n*** Testing error conditions of array_splice() ***\n";
                     11: 
                     12: $int=1;
                     13: $array=array(1,2);
                     14: var_dump (array_splice());
                     15: var_dump (array_splice($int));
                     16: var_dump (array_splice($array));
                     17: var_dump (array_splice($int,$int));
                     18: $obj= new stdclass;
                     19: var_dump (array_splice($obj,0,1));
                     20: echo "Done\n";
                     21: 
                     22: ?>
                     23: --EXPECTF--
                     24: 
                     25: *** Testing error conditions of array_splice() ***
                     26: 
                     27: Warning: array_splice() expects at least 2 parameters, 0 given in %s on line %d
                     28: NULL
                     29: 
                     30: Warning: array_splice() expects at least 2 parameters, 1 given in %s on line %d
                     31: NULL
                     32: 
                     33: Warning: array_splice() expects at least 2 parameters, 1 given in %s on line %d
                     34: NULL
                     35: 
                     36: Warning: array_splice() expects parameter 1 to be array, integer given in %s on line %d
                     37: NULL
                     38: 
                     39: Warning: array_splice() expects parameter 1 to be array, object given in %s on line %d
                     40: NULL
                     41: Done

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