--TEST-- Test array_slice() function : usage variations - Pass different data types as $offset arg --SKIPIF-- 4) die("skip this test is for 32bit platform only"); ?> --FILE-- 1, 2, 'three' => 3, 4); //get an unset variable $unset_var = 10; unset ($unset_var); // get a class class classA { public function __toString() { return "Class A object"; } } // heredoc string $heredoc = << --EXPECTF-- *** Testing array_slice() : usage variations *** -- Iteration 1 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 2 -- array(3) { [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 3 -- array(0) { } -- Iteration 4 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 5 -- array(0) { } -- Iteration 6 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 7 -- Warning: array_slice() expects parameter 2 to be int, float given in %s on line %d NULL -- Iteration 8 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 9 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 10 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 11 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 12 -- array(3) { [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 13 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 14 -- array(3) { [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 15 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 16 -- Warning: array_slice() expects parameter 2 to be int, string given in %s on line %d NULL -- Iteration 17 -- Warning: array_slice() expects parameter 2 to be int, string given in %s on line %d NULL -- Iteration 18 -- Warning: array_slice() expects parameter 2 to be int, array given in %s on line %d NULL -- Iteration 19 -- Warning: array_slice() expects parameter 2 to be int, string given in %s on line %d NULL -- Iteration 20 -- Warning: array_slice() expects parameter 2 to be int, string given in %s on line %d NULL -- Iteration 21 -- Warning: array_slice() expects parameter 2 to be int, string given in %s on line %d NULL -- Iteration 22 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } -- Iteration 23 -- array(4) { ["one"]=> int(1) [0]=> int(2) ["three"]=> int(3) [1]=> int(4) } Done