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
8 * Pass an incorrect number of arguments to array_slice() to test behaviour
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";
18 $preserve_keys = true;
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) );