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