1--TEST--
2Test array_diff_key() function : usage variation - Passing boolean indexed array
3--FILE--
4<?php
5/* Prototype  : array array_diff_key(array arr1, array arr2 [, array ...])
6 * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
7 * Source code: ext/standard/array.c
8 */
9
10echo "*** Testing array_diff_key() : usage variation ***\n";
11
12// Initialise function arguments not being substituted (if any)
13$input_array = array(0 => '0', 1 => '1', -10 => '-10', 'true' => 1, 'false' => 0);
14$boolean_indx_array = array(true => 'boolt', false => 'boolf', TRUE => 'boolT', FALSE => 'boolF');
15
16echo "\n-- Testing array_diff_key() function with boolean indexed array --\n";
17// loop through each element of the array for arr1
18var_dump( array_diff_key($input_array, $boolean_indx_array) );
19var_dump( array_diff_key($boolean_indx_array, $input_array) );
20?>
21===DONE===
22--EXPECTF--
23*** Testing array_diff_key() : usage variation ***
24
25-- Testing array_diff_key() function with boolean indexed array --
26array(3) {
27  [-10]=>
28  string(3) "-10"
29  ["true"]=>
30  int(1)
31  ["false"]=>
32  int(0)
33}
34array(0) {
35}
36===DONE===