1--TEST-- 2Test array_change_key_case() function : usage variations - different int values for $case 3--FILE-- 4<?php 5/* Prototype : array array_change_key_case(array $input [, int $case]) 6 * Description: Returns an array with all string keys lowercased [or uppercased] 7 * Source code: ext/standard/array.c 8 */ 9 10/* 11 * Pass different integer values as $case argument to array_change_key_case() to test behaviour 12 */ 13 14echo "*** Testing array_change_key_case() : usage variations ***\n"; 15 16$input = array('One' => 'un', 'TWO' => 'deux', 'three' => 'trois'); 17for ($i = -5; $i <=5; $i += 1){ 18 echo "\n-- \$sort argument is $i --\n"; 19 $temp = $input; 20 var_dump(array_change_key_case($temp, $i)); 21} 22 23echo "Done"; 24?> 25--EXPECT-- 26*** Testing array_change_key_case() : usage variations *** 27 28-- $sort argument is -5 -- 29array(3) { 30 ["ONE"]=> 31 string(2) "un" 32 ["TWO"]=> 33 string(4) "deux" 34 ["THREE"]=> 35 string(5) "trois" 36} 37 38-- $sort argument is -4 -- 39array(3) { 40 ["ONE"]=> 41 string(2) "un" 42 ["TWO"]=> 43 string(4) "deux" 44 ["THREE"]=> 45 string(5) "trois" 46} 47 48-- $sort argument is -3 -- 49array(3) { 50 ["ONE"]=> 51 string(2) "un" 52 ["TWO"]=> 53 string(4) "deux" 54 ["THREE"]=> 55 string(5) "trois" 56} 57 58-- $sort argument is -2 -- 59array(3) { 60 ["ONE"]=> 61 string(2) "un" 62 ["TWO"]=> 63 string(4) "deux" 64 ["THREE"]=> 65 string(5) "trois" 66} 67 68-- $sort argument is -1 -- 69array(3) { 70 ["ONE"]=> 71 string(2) "un" 72 ["TWO"]=> 73 string(4) "deux" 74 ["THREE"]=> 75 string(5) "trois" 76} 77 78-- $sort argument is 0 -- 79array(3) { 80 ["one"]=> 81 string(2) "un" 82 ["two"]=> 83 string(4) "deux" 84 ["three"]=> 85 string(5) "trois" 86} 87 88-- $sort argument is 1 -- 89array(3) { 90 ["ONE"]=> 91 string(2) "un" 92 ["TWO"]=> 93 string(4) "deux" 94 ["THREE"]=> 95 string(5) "trois" 96} 97 98-- $sort argument is 2 -- 99array(3) { 100 ["ONE"]=> 101 string(2) "un" 102 ["TWO"]=> 103 string(4) "deux" 104 ["THREE"]=> 105 string(5) "trois" 106} 107 108-- $sort argument is 3 -- 109array(3) { 110 ["ONE"]=> 111 string(2) "un" 112 ["TWO"]=> 113 string(4) "deux" 114 ["THREE"]=> 115 string(5) "trois" 116} 117 118-- $sort argument is 4 -- 119array(3) { 120 ["ONE"]=> 121 string(2) "un" 122 ["TWO"]=> 123 string(4) "deux" 124 ["THREE"]=> 125 string(5) "trois" 126} 127 128-- $sort argument is 5 -- 129array(3) { 130 ["ONE"]=> 131 string(2) "un" 132 ["TWO"]=> 133 string(4) "deux" 134 ["THREE"]=> 135 string(5) "trois" 136} 137Done 138