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--EXPECTF--
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(4) {
58  [0]=>
59  int(0)
60  [1]=>
61  int(2)
62  [2]=>
63  string(3) "php"
64  [3]=>
65  string(0) ""
66}
67int(-1)
68array(1) {
69  [0]=>
70  int(-1)
71}
72string(1) "1"
73array(1) {
74  [0]=>
75  int(1)
76}
77string(1) "0"
78array(1) {
79  [0]=>
80  int(0)
81}
82string(2) "-1"
83array(1) {
84  [0]=>
85  int(-1)
86}
87NULL
88array(3) {
89  [0]=>
90  int(2)
91  [1]=>
92  int(3)
93  [2]=>
94  string(0) ""
95}
96array(0) {
97}
98array(2) {
99  [0]=>
100  int(2)
101  [1]=>
102  int(3)
103}
104string(3) "php"
105array(1) {
106  [0]=>
107  string(3) "php"
108}
109string(0) ""
110array(2) {
111  [0]=>
112  int(2)
113  [1]=>
114  string(0) ""
115}
116Done
117