1--TEST-- 2Test array_slice() function : usage variations - position of internal array pointer 3--FILE-- 4<?php 5/* 6 * Check position of internal array pointer after calling array_slice() 7 */ 8 9echo "*** Testing array_slice() : usage variations ***\n"; 10 11$input = array ('one' => 'un', 'two' => 'deux', 23 => 'twenty-three', 'zero'); 12 13echo "\n-- Call array_slice() --\n"; 14var_dump($result = array_slice($input, 2)); 15 16echo "-- Position of Internal Pointer in Result: --\n"; 17echo key($result) . " => " . current($result) . "\n"; 18echo "\n-- Position of Internal Pointer in Original Array: --\n"; 19echo key($input) . " => " . current ($input) . "\n"; 20 21echo "Done"; 22?> 23--EXPECT-- 24*** Testing array_slice() : usage variations *** 25 26-- Call array_slice() -- 27array(2) { 28 [0]=> 29 string(12) "twenty-three" 30 [1]=> 31 string(4) "zero" 32} 33-- Position of Internal Pointer in Result: -- 340 => twenty-three 35 36-- Position of Internal Pointer in Original Array: -- 37one => un 38Done 39