1--TEST--
2Test array_diff_ukey() function : usage variation - Passing boolean indexed array
3--FILE--
4<?php
5/* Prototype  : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
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_ukey() : 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
16function key_compare_func($key1, $key2)
17{
18  return strcasecmp($key1, $key2);
19}
20
21echo "\n-- Testing array_diff_ukey() function with boolean indexed array --\n";
22
23var_dump( array_diff_ukey($boolean_indx_array, $input_array, 'key_compare_func') );
24var_dump( array_diff_ukey($input_array, $boolean_indx_array, 'key_compare_func') );
25
26?>
27===DONE===
28--EXPECTF--
29*** Testing array_diff_ukey() : usage variation ***
30
31-- Testing array_diff_ukey() function with boolean indexed array --
32array(0) {
33}
34array(3) {
35  [-10]=>
36  string(3) "-10"
37  ["true"]=>
38  int(1)
39  ["false"]=>
40  int(0)
41}
42===DONE===
43