import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / array_slice_error.php
blob2807c07e06d23f6708679fa04808bdf29f041dae
1 <?php
2 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
3 * Description: Returns elements specified by offset and length
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Pass an incorrect number of arguments to array_slice() to test behaviour
9 */
11 echo "*** Testing array_slice() : error conditions ***\n";
13 //Test array_slice with one more than the expected number of arguments
14 echo "\n-- Testing array_slice() function with more than expected no. of arguments --\n";
15 $input = array(1, 2);
16 $offset = 10;
17 $length = 10;
18 $preserve_keys = true;
19 $extra_arg = 10;
20 var_dump( array_slice($input, $offset, $length, $preserve_keys, $extra_arg) );
22 // Testing array_slice with one less than the expected number of arguments
23 echo "\n-- Testing array_slice() function with less than expected no. of arguments --\n";
24 var_dump( array_slice($input) );
26 echo "Done";