1--TEST-- 2Test array_keys() function (variation - 3) 3--FILE-- 4<?php 5 6echo "*** Testing array_keys() on all the types other than arrays ***\n"; 7$types_arr = array( 8 TRUE => TRUE, 9 FALSE => FALSE, 10 1 => 1, 11 0 => 0, 12 -1 => -1, 13 "1" => "1", 14 "0" => "0", 15 "-1" => "-1", 16 NULL, 17 array(), 18 "php" => "php", 19 "" => "" 20); 21$values = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", ""); 22foreach ($values as $value){ 23 var_dump($value); 24 var_dump(array_keys($types_arr, $value)); 25} 26 27echo "Done\n"; 28?> 29--EXPECT-- 30*** Testing array_keys() on all the types other than arrays *** 31bool(true) 32array(3) { 33 [0]=> 34 int(1) 35 [1]=> 36 int(-1) 37 [2]=> 38 string(3) "php" 39} 40bool(false) 41array(4) { 42 [0]=> 43 int(0) 44 [1]=> 45 int(2) 46 [2]=> 47 int(3) 48 [3]=> 49 string(0) "" 50} 51int(1) 52array(1) { 53 [0]=> 54 int(1) 55} 56int(0) 57array(2) { 58 [0]=> 59 int(0) 60 [1]=> 61 int(2) 62} 63int(-1) 64array(1) { 65 [0]=> 66 int(-1) 67} 68string(1) "1" 69array(1) { 70 [0]=> 71 int(1) 72} 73string(1) "0" 74array(1) { 75 [0]=> 76 int(0) 77} 78string(2) "-1" 79array(1) { 80 [0]=> 81 int(-1) 82} 83NULL 84array(3) { 85 [0]=> 86 int(2) 87 [1]=> 88 int(3) 89 [2]=> 90 string(0) "" 91} 92array(0) { 93} 94array(2) { 95 [0]=> 96 int(2) 97 [1]=> 98 int(3) 99} 100string(3) "php" 101array(1) { 102 [0]=> 103 string(3) "php" 104} 105string(0) "" 106array(2) { 107 [0]=> 108 int(2) 109 [1]=> 110 string(0) "" 111} 112Done 113