1--TEST--
2Test array_slice() function : basic functionality
3--FILE--
4<?php
5/*
6 * Test basic functionality of array_slice()
7 */
8
9echo "*** Testing array_slice() : basic functionality ***\n";
10
11
12$input = array('one' => 1, 'two' => 2, 3, 23 => 4);
13$offset = 2;
14$length = 2;
15$preserve_keys = true;
16
17// Calling array_slice() with all possible arguments
18echo "\n-- All arguments --\n";
19var_dump( array_slice($input, $offset, $length, $preserve_keys) );
20
21// Calling array_slice() with mandatory arguments
22echo "\n-- Mandatory arguments --\n";
23var_dump( array_slice($input, $offset) );
24
25echo "Done";
26?>
27--EXPECT--
28*** Testing array_slice() : basic functionality ***
29
30-- All arguments --
31array(2) {
32  [0]=>
33  int(3)
34  [23]=>
35  int(4)
36}
37
38-- Mandatory arguments --
39array(2) {
40  [0]=>
41  int(3)
42  [1]=>
43  int(4)
44}
45Done
46