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