1--TEST-- 2Test array_values() function : usage variations - Internal order check 3--FILE-- 4<?php 5/* Prototype : array array_values(array $input) 6 * Description: Return just the values from the input array 7 * Source code: ext/standard/array.c 8 */ 9 10/* 11 * Check that array_values is re-assigning keys according to the internal order of the array, 12 * and is not dependent on the \$input argument's keys 13 */ 14 15echo "*** Testing array_values() : usage variations ***\n"; 16 17// populate array with 'default' keys in reverse order 18$input = array(3 => 'three', 2 => 'two', 1 => 'one', 0 => 'zero'); 19 20echo "\n-- \$input argument: --\n"; 21var_dump($input); 22 23echo "\n-- Result of array_values() --\n"; 24var_dump(array_values($input)); 25 26echo "Done"; 27?> 28--EXPECT-- 29*** Testing array_values() : usage variations *** 30 31-- $input argument: -- 32array(4) { 33 [3]=> 34 string(5) "three" 35 [2]=> 36 string(3) "two" 37 [1]=> 38 string(3) "one" 39 [0]=> 40 string(4) "zero" 41} 42 43-- Result of array_values() -- 44array(4) { 45 [0]=> 46 string(5) "three" 47 [1]=> 48 string(3) "two" 49 [2]=> 50 string(3) "one" 51 [3]=> 52 string(4) "zero" 53} 54Done 55