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: Retuns 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
26--EXPECTF--
27*** Testing array_change_key_case() : usage variations ***
28
29-- $sort argument is -5 --
30array(3) {
31  ["ONE"]=>
32  string(2) "un"
33  ["TWO"]=>
34  string(4) "deux"
35  ["THREE"]=>
36  string(5) "trois"
37}
38
39-- $sort argument is -4 --
40array(3) {
41  ["ONE"]=>
42  string(2) "un"
43  ["TWO"]=>
44  string(4) "deux"
45  ["THREE"]=>
46  string(5) "trois"
47}
48
49-- $sort argument is -3 --
50array(3) {
51  ["ONE"]=>
52  string(2) "un"
53  ["TWO"]=>
54  string(4) "deux"
55  ["THREE"]=>
56  string(5) "trois"
57}
58
59-- $sort argument is -2 --
60array(3) {
61  ["ONE"]=>
62  string(2) "un"
63  ["TWO"]=>
64  string(4) "deux"
65  ["THREE"]=>
66  string(5) "trois"
67}
68
69-- $sort argument is -1 --
70array(3) {
71  ["ONE"]=>
72  string(2) "un"
73  ["TWO"]=>
74  string(4) "deux"
75  ["THREE"]=>
76  string(5) "trois"
77}
78
79-- $sort argument is 0 --
80array(3) {
81  ["one"]=>
82  string(2) "un"
83  ["two"]=>
84  string(4) "deux"
85  ["three"]=>
86  string(5) "trois"
87}
88
89-- $sort argument is 1 --
90array(3) {
91  ["ONE"]=>
92  string(2) "un"
93  ["TWO"]=>
94  string(4) "deux"
95  ["THREE"]=>
96  string(5) "trois"
97}
98
99-- $sort argument is 2 --
100array(3) {
101  ["ONE"]=>
102  string(2) "un"
103  ["TWO"]=>
104  string(4) "deux"
105  ["THREE"]=>
106  string(5) "trois"
107}
108
109-- $sort argument is 3 --
110array(3) {
111  ["ONE"]=>
112  string(2) "un"
113  ["TWO"]=>
114  string(4) "deux"
115  ["THREE"]=>
116  string(5) "trois"
117}
118
119-- $sort argument is 4 --
120array(3) {
121  ["ONE"]=>
122  string(2) "un"
123  ["TWO"]=>
124  string(4) "deux"
125  ["THREE"]=>
126  string(5) "trois"
127}
128
129-- $sort argument is 5 --
130array(3) {
131  ["ONE"]=>
132  string(2) "un"
133  ["TWO"]=>
134  string(4) "deux"
135  ["THREE"]=>
136  string(5) "trois"
137}
138Done