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