1--TEST--
2Test array_diff_key() function : usage variation - Passing float 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', 10 => '10', -10 => '-10', 20 =>'20', -20 => '-20');
14$float_indx_array = array(0.0 => '0.0', 10.5 => '10.5', -10.5 => '-10.5', 0.5 => '0.5');
15
16echo "\n-- Testing array_diff_key() function with float indexed array --\n";
17// loop through each element of the array for arr1
18var_dump( array_diff_key($input_array, $float_indx_array) );
19var_dump( array_diff_key($float_indx_array, $input_array) );
20?>
21===DONE===
22--EXPECTF--
23*** Testing array_diff_key() : usage variation ***
24
25-- Testing array_diff_key() function with float indexed array --
26array(2) {
27  [20]=>
28  string(2) "20"
29  [-20]=>
30  string(3) "-20"
31}
32array(0) {
33}
34===DONE===