1--TEST--
2Test array_change_key_case() function
3--FILE--
4<?php
5$arrays = array (
6  array (),
7  array (0),
8  array (1),
9  array (-1),
10  array (0, 2, 3, 4, 5),
11  array (1, 2, 3, 4, 5),
12  array ("" => 1),
13  array ("a" => 1),
14  array ("Z" => 1),
15  array ("one" => 1),
16  array ("ONE" => 1),
17  array ("OnE" => 1),
18  array ("oNe" => 1),
19  array ("one" => 1, "two" => 2),
20  array ("ONE" => 1, "two" => 2),
21  array ("OnE" => 1, "two" => 2),
22  array ("oNe" => 1, "two" => 2),
23  array ("one" => 1, "TWO" => 2),
24  array ("ONE" => 1, "TWO" => 2),
25  array ("OnE" => 1, "TWO" => 2),
26  array ("oNe" => 1, "TWO" => 2),
27  array ("one" => 1, "TwO" => 2),
28  array ("ONE" => 1, "TwO" => 2),
29  array ("OnE" => 1, "TwO" => 2),
30  array ("oNe" => 1, "TwO" => 2),
31  array ("one" => 1, "tWo" => 2),
32  array ("ONE" => 1, "tWo" => 2),
33  array ("OnE" => 1, "tWo" => 2),
34  array ("oNe" => 1, "tWo" => 2),
35  array ("one" => 1, 2),
36  array ("ONE" => 1, 2),
37  array ("OnE" => 1, 2),
38  array ("oNe" => 1, 2),
39  array ("ONE" => 1, "TWO" => 2, "THREE" => 3, "FOUR" => "four"),
40  array ("one" => 1, "two" => 2, "three" => 3, "four" => "FOUR"),
41  array ("ONE" => 1, "TWO" => 2, "three" => 3, "four" => "FOUR"),
42  array ("one" => 1, "two" => 2, "THREE" => 3, "FOUR" => "four")
43);
44
45echo "*** Testing basic operations ***\n";
46$loop_counter = 1;
47foreach ($arrays as $item) {
48        echo "** Iteration $loop_counter **\n"; $loop_counter++;
49    var_dump(array_change_key_case($item));
50    var_dump(array_change_key_case($item, CASE_UPPER));
51    var_dump(array_change_key_case($item, CASE_LOWER));
52    echo "\n";
53}
54
55echo "end\n";
56?>
57--EXPECT--
58*** Testing basic operations ***
59** Iteration 1 **
60array(0) {
61}
62array(0) {
63}
64array(0) {
65}
66
67** Iteration 2 **
68array(1) {
69  [0]=>
70  int(0)
71}
72array(1) {
73  [0]=>
74  int(0)
75}
76array(1) {
77  [0]=>
78  int(0)
79}
80
81** Iteration 3 **
82array(1) {
83  [0]=>
84  int(1)
85}
86array(1) {
87  [0]=>
88  int(1)
89}
90array(1) {
91  [0]=>
92  int(1)
93}
94
95** Iteration 4 **
96array(1) {
97  [0]=>
98  int(-1)
99}
100array(1) {
101  [0]=>
102  int(-1)
103}
104array(1) {
105  [0]=>
106  int(-1)
107}
108
109** Iteration 5 **
110array(5) {
111  [0]=>
112  int(0)
113  [1]=>
114  int(2)
115  [2]=>
116  int(3)
117  [3]=>
118  int(4)
119  [4]=>
120  int(5)
121}
122array(5) {
123  [0]=>
124  int(0)
125  [1]=>
126  int(2)
127  [2]=>
128  int(3)
129  [3]=>
130  int(4)
131  [4]=>
132  int(5)
133}
134array(5) {
135  [0]=>
136  int(0)
137  [1]=>
138  int(2)
139  [2]=>
140  int(3)
141  [3]=>
142  int(4)
143  [4]=>
144  int(5)
145}
146
147** Iteration 6 **
148array(5) {
149  [0]=>
150  int(1)
151  [1]=>
152  int(2)
153  [2]=>
154  int(3)
155  [3]=>
156  int(4)
157  [4]=>
158  int(5)
159}
160array(5) {
161  [0]=>
162  int(1)
163  [1]=>
164  int(2)
165  [2]=>
166  int(3)
167  [3]=>
168  int(4)
169  [4]=>
170  int(5)
171}
172array(5) {
173  [0]=>
174  int(1)
175  [1]=>
176  int(2)
177  [2]=>
178  int(3)
179  [3]=>
180  int(4)
181  [4]=>
182  int(5)
183}
184
185** Iteration 7 **
186array(1) {
187  [""]=>
188  int(1)
189}
190array(1) {
191  [""]=>
192  int(1)
193}
194array(1) {
195  [""]=>
196  int(1)
197}
198
199** Iteration 8 **
200array(1) {
201  ["a"]=>
202  int(1)
203}
204array(1) {
205  ["A"]=>
206  int(1)
207}
208array(1) {
209  ["a"]=>
210  int(1)
211}
212
213** Iteration 9 **
214array(1) {
215  ["z"]=>
216  int(1)
217}
218array(1) {
219  ["Z"]=>
220  int(1)
221}
222array(1) {
223  ["z"]=>
224  int(1)
225}
226
227** Iteration 10 **
228array(1) {
229  ["one"]=>
230  int(1)
231}
232array(1) {
233  ["ONE"]=>
234  int(1)
235}
236array(1) {
237  ["one"]=>
238  int(1)
239}
240
241** Iteration 11 **
242array(1) {
243  ["one"]=>
244  int(1)
245}
246array(1) {
247  ["ONE"]=>
248  int(1)
249}
250array(1) {
251  ["one"]=>
252  int(1)
253}
254
255** Iteration 12 **
256array(1) {
257  ["one"]=>
258  int(1)
259}
260array(1) {
261  ["ONE"]=>
262  int(1)
263}
264array(1) {
265  ["one"]=>
266  int(1)
267}
268
269** Iteration 13 **
270array(1) {
271  ["one"]=>
272  int(1)
273}
274array(1) {
275  ["ONE"]=>
276  int(1)
277}
278array(1) {
279  ["one"]=>
280  int(1)
281}
282
283** Iteration 14 **
284array(2) {
285  ["one"]=>
286  int(1)
287  ["two"]=>
288  int(2)
289}
290array(2) {
291  ["ONE"]=>
292  int(1)
293  ["TWO"]=>
294  int(2)
295}
296array(2) {
297  ["one"]=>
298  int(1)
299  ["two"]=>
300  int(2)
301}
302
303** Iteration 15 **
304array(2) {
305  ["one"]=>
306  int(1)
307  ["two"]=>
308  int(2)
309}
310array(2) {
311  ["ONE"]=>
312  int(1)
313  ["TWO"]=>
314  int(2)
315}
316array(2) {
317  ["one"]=>
318  int(1)
319  ["two"]=>
320  int(2)
321}
322
323** Iteration 16 **
324array(2) {
325  ["one"]=>
326  int(1)
327  ["two"]=>
328  int(2)
329}
330array(2) {
331  ["ONE"]=>
332  int(1)
333  ["TWO"]=>
334  int(2)
335}
336array(2) {
337  ["one"]=>
338  int(1)
339  ["two"]=>
340  int(2)
341}
342
343** Iteration 17 **
344array(2) {
345  ["one"]=>
346  int(1)
347  ["two"]=>
348  int(2)
349}
350array(2) {
351  ["ONE"]=>
352  int(1)
353  ["TWO"]=>
354  int(2)
355}
356array(2) {
357  ["one"]=>
358  int(1)
359  ["two"]=>
360  int(2)
361}
362
363** Iteration 18 **
364array(2) {
365  ["one"]=>
366  int(1)
367  ["two"]=>
368  int(2)
369}
370array(2) {
371  ["ONE"]=>
372  int(1)
373  ["TWO"]=>
374  int(2)
375}
376array(2) {
377  ["one"]=>
378  int(1)
379  ["two"]=>
380  int(2)
381}
382
383** Iteration 19 **
384array(2) {
385  ["one"]=>
386  int(1)
387  ["two"]=>
388  int(2)
389}
390array(2) {
391  ["ONE"]=>
392  int(1)
393  ["TWO"]=>
394  int(2)
395}
396array(2) {
397  ["one"]=>
398  int(1)
399  ["two"]=>
400  int(2)
401}
402
403** Iteration 20 **
404array(2) {
405  ["one"]=>
406  int(1)
407  ["two"]=>
408  int(2)
409}
410array(2) {
411  ["ONE"]=>
412  int(1)
413  ["TWO"]=>
414  int(2)
415}
416array(2) {
417  ["one"]=>
418  int(1)
419  ["two"]=>
420  int(2)
421}
422
423** Iteration 21 **
424array(2) {
425  ["one"]=>
426  int(1)
427  ["two"]=>
428  int(2)
429}
430array(2) {
431  ["ONE"]=>
432  int(1)
433  ["TWO"]=>
434  int(2)
435}
436array(2) {
437  ["one"]=>
438  int(1)
439  ["two"]=>
440  int(2)
441}
442
443** Iteration 22 **
444array(2) {
445  ["one"]=>
446  int(1)
447  ["two"]=>
448  int(2)
449}
450array(2) {
451  ["ONE"]=>
452  int(1)
453  ["TWO"]=>
454  int(2)
455}
456array(2) {
457  ["one"]=>
458  int(1)
459  ["two"]=>
460  int(2)
461}
462
463** Iteration 23 **
464array(2) {
465  ["one"]=>
466  int(1)
467  ["two"]=>
468  int(2)
469}
470array(2) {
471  ["ONE"]=>
472  int(1)
473  ["TWO"]=>
474  int(2)
475}
476array(2) {
477  ["one"]=>
478  int(1)
479  ["two"]=>
480  int(2)
481}
482
483** Iteration 24 **
484array(2) {
485  ["one"]=>
486  int(1)
487  ["two"]=>
488  int(2)
489}
490array(2) {
491  ["ONE"]=>
492  int(1)
493  ["TWO"]=>
494  int(2)
495}
496array(2) {
497  ["one"]=>
498  int(1)
499  ["two"]=>
500  int(2)
501}
502
503** Iteration 25 **
504array(2) {
505  ["one"]=>
506  int(1)
507  ["two"]=>
508  int(2)
509}
510array(2) {
511  ["ONE"]=>
512  int(1)
513  ["TWO"]=>
514  int(2)
515}
516array(2) {
517  ["one"]=>
518  int(1)
519  ["two"]=>
520  int(2)
521}
522
523** Iteration 26 **
524array(2) {
525  ["one"]=>
526  int(1)
527  ["two"]=>
528  int(2)
529}
530array(2) {
531  ["ONE"]=>
532  int(1)
533  ["TWO"]=>
534  int(2)
535}
536array(2) {
537  ["one"]=>
538  int(1)
539  ["two"]=>
540  int(2)
541}
542
543** Iteration 27 **
544array(2) {
545  ["one"]=>
546  int(1)
547  ["two"]=>
548  int(2)
549}
550array(2) {
551  ["ONE"]=>
552  int(1)
553  ["TWO"]=>
554  int(2)
555}
556array(2) {
557  ["one"]=>
558  int(1)
559  ["two"]=>
560  int(2)
561}
562
563** Iteration 28 **
564array(2) {
565  ["one"]=>
566  int(1)
567  ["two"]=>
568  int(2)
569}
570array(2) {
571  ["ONE"]=>
572  int(1)
573  ["TWO"]=>
574  int(2)
575}
576array(2) {
577  ["one"]=>
578  int(1)
579  ["two"]=>
580  int(2)
581}
582
583** Iteration 29 **
584array(2) {
585  ["one"]=>
586  int(1)
587  ["two"]=>
588  int(2)
589}
590array(2) {
591  ["ONE"]=>
592  int(1)
593  ["TWO"]=>
594  int(2)
595}
596array(2) {
597  ["one"]=>
598  int(1)
599  ["two"]=>
600  int(2)
601}
602
603** Iteration 30 **
604array(2) {
605  ["one"]=>
606  int(1)
607  [0]=>
608  int(2)
609}
610array(2) {
611  ["ONE"]=>
612  int(1)
613  [0]=>
614  int(2)
615}
616array(2) {
617  ["one"]=>
618  int(1)
619  [0]=>
620  int(2)
621}
622
623** Iteration 31 **
624array(2) {
625  ["one"]=>
626  int(1)
627  [0]=>
628  int(2)
629}
630array(2) {
631  ["ONE"]=>
632  int(1)
633  [0]=>
634  int(2)
635}
636array(2) {
637  ["one"]=>
638  int(1)
639  [0]=>
640  int(2)
641}
642
643** Iteration 32 **
644array(2) {
645  ["one"]=>
646  int(1)
647  [0]=>
648  int(2)
649}
650array(2) {
651  ["ONE"]=>
652  int(1)
653  [0]=>
654  int(2)
655}
656array(2) {
657  ["one"]=>
658  int(1)
659  [0]=>
660  int(2)
661}
662
663** Iteration 33 **
664array(2) {
665  ["one"]=>
666  int(1)
667  [0]=>
668  int(2)
669}
670array(2) {
671  ["ONE"]=>
672  int(1)
673  [0]=>
674  int(2)
675}
676array(2) {
677  ["one"]=>
678  int(1)
679  [0]=>
680  int(2)
681}
682
683** Iteration 34 **
684array(4) {
685  ["one"]=>
686  int(1)
687  ["two"]=>
688  int(2)
689  ["three"]=>
690  int(3)
691  ["four"]=>
692  string(4) "four"
693}
694array(4) {
695  ["ONE"]=>
696  int(1)
697  ["TWO"]=>
698  int(2)
699  ["THREE"]=>
700  int(3)
701  ["FOUR"]=>
702  string(4) "four"
703}
704array(4) {
705  ["one"]=>
706  int(1)
707  ["two"]=>
708  int(2)
709  ["three"]=>
710  int(3)
711  ["four"]=>
712  string(4) "four"
713}
714
715** Iteration 35 **
716array(4) {
717  ["one"]=>
718  int(1)
719  ["two"]=>
720  int(2)
721  ["three"]=>
722  int(3)
723  ["four"]=>
724  string(4) "FOUR"
725}
726array(4) {
727  ["ONE"]=>
728  int(1)
729  ["TWO"]=>
730  int(2)
731  ["THREE"]=>
732  int(3)
733  ["FOUR"]=>
734  string(4) "FOUR"
735}
736array(4) {
737  ["one"]=>
738  int(1)
739  ["two"]=>
740  int(2)
741  ["three"]=>
742  int(3)
743  ["four"]=>
744  string(4) "FOUR"
745}
746
747** Iteration 36 **
748array(4) {
749  ["one"]=>
750  int(1)
751  ["two"]=>
752  int(2)
753  ["three"]=>
754  int(3)
755  ["four"]=>
756  string(4) "FOUR"
757}
758array(4) {
759  ["ONE"]=>
760  int(1)
761  ["TWO"]=>
762  int(2)
763  ["THREE"]=>
764  int(3)
765  ["FOUR"]=>
766  string(4) "FOUR"
767}
768array(4) {
769  ["one"]=>
770  int(1)
771  ["two"]=>
772  int(2)
773  ["three"]=>
774  int(3)
775  ["four"]=>
776  string(4) "FOUR"
777}
778
779** Iteration 37 **
780array(4) {
781  ["one"]=>
782  int(1)
783  ["two"]=>
784  int(2)
785  ["three"]=>
786  int(3)
787  ["four"]=>
788  string(4) "four"
789}
790array(4) {
791  ["ONE"]=>
792  int(1)
793  ["TWO"]=>
794  int(2)
795  ["THREE"]=>
796  int(3)
797  ["FOUR"]=>
798  string(4) "four"
799}
800array(4) {
801  ["one"]=>
802  int(1)
803  ["two"]=>
804  int(2)
805  ["three"]=>
806  int(3)
807  ["four"]=>
808  string(4) "four"
809}
810
811end
812