1--TEST--
2Test array_key_exists() function : usage variations - multidimensional arrays
3--FILE--
4<?php
5/*
6 * Test how array_key_exists() behaves with multi-dimensional arrays
7 */
8
9echo "*** Testing array_key_exists() : usage variations ***\n";
10
11$multi_array = array ('zero' => 'val1',
12                      'one' => 'val2',
13                      'sub1' => array (1, 2, 3));
14
15echo "\n-- Attempt to match key in sub-array --\n";
16// this key is in the sub-array
17var_dump(array_key_exists(0, $multi_array));
18
19echo "\n-- \$search arg points to sub-array --\n";
20var_dump(array_key_exists(0, $multi_array['sub1']));
21
22echo "Done";
23?>
24--EXPECT--
25*** Testing array_key_exists() : usage variations ***
26
27-- Attempt to match key in sub-array --
28bool(false)
29
30-- $search arg points to sub-array --
31bool(true)
32Done
33