1--TEST--
2Test array_diff_ukey() function : usage variation - Passing float 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', 10 => '10', -10 => '-10', 20 =>'20');
14$float_indx_array = array(0.0 => '0.0', 10.5 => '10.5', -30.5 => '-30.5');
15
16function key_compare_func($key1, $key2)
17{
18  return strcasecmp($key1, $key2);
19}
20
21echo "\n-- Testing array_diff_ukey() function with float indexed array --\n";
22
23var_dump( array_diff_ukey($float_indx_array, $input_array, 'key_compare_func') );
24var_dump( array_diff_ukey($input_array, $float_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 float indexed array --
32array(1) {
33  [-30]=>
34  string(5) "-30.5"
35}
36array(2) {
37  [-10]=>
38  string(3) "-10"
39  [20]=>
40  string(2) "20"
41}
42===DONE===
43