1--TEST--
2Test array_change_key_case() function : usage variations - referenced variables
3--FILE--
4<?php
5/*
6 * Test array_change_key_case() when:
7 * 1. Passed a referenced variable
8 * 2. Passed an argument by reference
9 */
10
11echo "*** Testing array_change_key_case() : usage variations ***\n";
12
13$input = array('one' => 1, 'two' => 2, 'ABC' => 'xyz');
14
15echo "\n-- \$input argument is a reference to array --\n";
16$new_input = &$input;
17echo "Result:\n";
18var_dump(array_change_key_case($new_input, CASE_UPPER));
19echo "Original:\n";
20var_dump($input);
21echo "Referenced:\n";
22var_dump($new_input);
23
24echo "Done";
25?>
26--EXPECT--
27*** Testing array_change_key_case() : usage variations ***
28
29-- $input argument is a reference to array --
30Result:
31array(3) {
32  ["ONE"]=>
33  int(1)
34  ["TWO"]=>
35  int(2)
36  ["ABC"]=>
37  string(3) "xyz"
38}
39Original:
40array(3) {
41  ["one"]=>
42  int(1)
43  ["two"]=>
44  int(2)
45  ["ABC"]=>
46  string(3) "xyz"
47}
48Referenced:
49array(3) {
50  ["one"]=>
51  int(1)
52  ["two"]=>
53  int(2)
54  ["ABC"]=>
55  string(3) "xyz"
56}
57Done
58