1--TEST--
2Test array_change_key_case() function - 2
3--FILE--
4<?php
5
6$item = array ("one" => 1, "two" => 2, "THREE" => 3, "FOUR" => "four");
7
8/* use 'case' argument other than CASE_LOWER & CASE_UPPER */
9try {
10    var_dump(array_change_key_case($item, "CASE_UPPER"));
11} catch (TypeError $e) {
12    echo $e->getMessage(), "\n";
13}
14var_dump(array_change_key_case($item, 5));
15
16/* when keys are different in terms of only case */
17/* should return one value key pair with key being in lowercase */
18var_dump( array_change_key_case( array("ONE" => 1, "one" => 3, "One" => 4) ) );
19
20/* should return one value key pair with key being in uppercase */
21var_dump( array_change_key_case( array("ONE" => 1, "one" => 2, "One" => 3), CASE_UPPER ) );
22var_dump( array_change_key_case( array("ONE" => 1, "one" => 1, "One" => 2), 5 ) );
23
24echo "end\n";
25?>
26--EXPECT--
27array_change_key_case(): Argument #2 ($case) must be of type int, string given
28array(4) {
29  ["ONE"]=>
30  int(1)
31  ["TWO"]=>
32  int(2)
33  ["THREE"]=>
34  int(3)
35  ["FOUR"]=>
36  string(4) "four"
37}
38array(1) {
39  ["one"]=>
40  int(4)
41}
42array(1) {
43  ["ONE"]=>
44  int(3)
45}
46array(1) {
47  ["ONE"]=>
48  int(2)
49}
50end
51