1--TEST--
2Test array_values() function : usage variations - Referenced variables
3--FILE--
4<?php
5/*
6 * Test array_values() when:
7 * 1. Passed an array made up of referenced variables
8 * 2. Passed an array by reference
9 */
10
11echo "*** Testing array_values() : usage variations ***\n";
12
13$val1 = 'one';
14$val2 = 'two';
15$val3 = 'three';
16
17echo "\n-- \$input is an array made up of referenced variables: --\n";
18$input = array(&$val1, &$val2, &$val3);
19var_dump($result1 = array_values($input));
20
21echo "Change \$val2 and check result of array_values():\n";
22$val2 = 'deux';
23var_dump($result1);
24
25echo "Done";
26?>
27--EXPECT--
28*** Testing array_values() : usage variations ***
29
30-- $input is an array made up of referenced variables: --
31array(3) {
32  [0]=>
33  &string(3) "one"
34  [1]=>
35  &string(3) "two"
36  [2]=>
37  &string(5) "three"
38}
39Change $val2 and check result of array_values():
40array(3) {
41  [0]=>
42  &string(3) "one"
43  [1]=>
44  &string(4) "deux"
45  [2]=>
46  &string(5) "three"
47}
48Done
49