1--TEST--
2Test array_slice() function : usage variations - multidimensional arrays
3--FILE--
4<?php
5/*
6 * Test array_slice when passed
7 * 1. a two-dimensional array as $input argument
8 * 2. a sub-array as $input argument
9 */
10
11echo "*** Testing array_slice() : usage variations ***\n";
12
13$input = array ('zero', 'one', array('zero', 'un', 'deux'), 9 => 'nine');
14
15echo "\n-- Slice a two-dimensional array --\n";
16var_dump(array_slice($input, 1, 3));
17
18echo "\n-- \$input is a sub-array --\n";
19var_dump(array_slice($input[2], 1, 2));
20
21echo "Done";
22?>
23--EXPECT--
24*** Testing array_slice() : usage variations ***
25
26-- Slice a two-dimensional array --
27array(3) {
28  [0]=>
29  string(3) "one"
30  [1]=>
31  array(3) {
32    [0]=>
33    string(4) "zero"
34    [1]=>
35    string(2) "un"
36    [2]=>
37    string(4) "deux"
38  }
39  [2]=>
40  string(4) "nine"
41}
42
43-- $input is a sub-array --
44array(2) {
45  [0]=>
46  string(2) "un"
47  [1]=>
48  string(4) "deux"
49}
50Done
51