Revert "make hphpc able to use ini files"
[hiphop-php.git] / hphp / test / zend / bad / ext / standard / tests / array / array_change_key_case_variation2.php
blob123e86f5158038deae611433adafd08c7495529f
1 <?php
2 /* Prototype : array array_change_key_case(array $input [, int $case])
3 * Description: Retuns an array with all string keys lowercased [or uppercased]
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Pass different data types as $case argument to array_change_key_case() to test behaviour
9 * Where possible, CASE_UPPER has been entered as a string value
12 echo "*** Testing array_change_key_case() : usage variations ***\n";
14 // Initialise function arguments not being substituted
15 $array = array ('one' => 1, 'TWO' => 2, 'Three' => 3);
17 //get an unset variable
18 $unset_var = 10;
19 unset ($unset_var);
21 // heredoc string
22 $heredoc = <<<EOT
23 CASE_UPPER
24 EOT;
26 // get a resource variable
27 $fp = fopen(__FILE__, "r");
29 // unexpected values to be passed to $case argument
30 $inputs = array(
32 // int data
33 /*1*/ 0,
35 12345,
36 -2345,
38 // float data
39 /*5*/ 10.5,
40 -10.5,
41 12.3456789000e10,
42 12.3456789000E-10,
43 .5,
45 // null data
46 /*10*/ NULL,
47 null,
49 // boolean data
50 /*12*/ true,
51 false,
52 TRUE,
53 FALSE,
55 // empty data
56 /*16*/ "",
57 '',
58 array(),
60 // string data
61 /*19*/ "CASE_UPPER",
62 'CASE_UPPER',
63 $heredoc,
65 // undefined data
66 /*22*/ @$undefined_var,
68 // unset data
69 /*23*/ @$unset_var,
72 // loop through each element of $inputs to check the behavior of array_change_key_case()
73 $iterator = 1;
74 foreach($inputs as $input) {
75 echo "\n-- Iteration $iterator --\n";
76 var_dump( array_change_key_case($array, $input) );
77 $iterator++;
80 echo "Done";