1--TEST--
2Test array_change_key_case() function : usage variations - multidimensional arrays
3--FILE--
4<?php
5/*
6 * Test how array_change_key_case() converts keys in multi-dimensional arrays
7 */
8
9echo "*** Testing array_change_key_case() : usage variations ***\n";
10
11$input = array('English' => array('one' => 1, 'two' => 2, 'three' => 3),
12               'French'  => array('un' => 1, 'deux' => 2, 'trois' => 3),
13               'German'  => array('eins' => 1, 'zwei' => 2, 'drei' => 3));
14
15echo "\n-- Pass a two-dimensional array as \$input argument --\n";
16var_dump(array_change_key_case($input, CASE_UPPER));
17
18echo "\n-- Pass a sub-array as \$input argument --\n";
19var_dump(array_change_key_case($input['English'], CASE_UPPER));
20
21echo "Done";
22?>
23--EXPECT--
24*** Testing array_change_key_case() : usage variations ***
25
26-- Pass a two-dimensional array as $input argument --
27array(3) {
28  ["ENGLISH"]=>
29  array(3) {
30    ["one"]=>
31    int(1)
32    ["two"]=>
33    int(2)
34    ["three"]=>
35    int(3)
36  }
37  ["FRENCH"]=>
38  array(3) {
39    ["un"]=>
40    int(1)
41    ["deux"]=>
42    int(2)
43    ["trois"]=>
44    int(3)
45  }
46  ["GERMAN"]=>
47  array(3) {
48    ["eins"]=>
49    int(1)
50    ["zwei"]=>
51    int(2)
52    ["drei"]=>
53    int(3)
54  }
55}
56
57-- Pass a sub-array as $input argument --
58array(3) {
59  ["ONE"]=>
60  int(1)
61  ["TWO"]=>
62  int(2)
63  ["THREE"]=>
64  int(3)
65}
66Done
67