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 dependant 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
29--EXPECTF--
30*** Testing array_values() : usage variations ***
31
32-- $input argument: --
33array(4) {
34  [3]=>
35  string(5) "three"
36  [2]=>
37  string(3) "two"
38  [1]=>
39  string(3) "one"
40  [0]=>
41  string(4) "zero"
42}
43
44-- Result of array_values() --
45array(4) {
46  [0]=>
47  string(5) "three"
48  [1]=>
49  string(3) "two"
50  [2]=>
51  string(3) "one"
52  [3]=>
53  string(4) "zero"
54}
55Done