xref: /PHP-8.1/ext/standard/tests/array/bug42838.phpt (revision f8d79582)
1--TEST--
2Bug #42838 (Wrong results in array_diff_uassoc())
3--FILE--
4<?php
5
6function key_compare_func($a, $b)
7{
8    if ($a === $b) {
9        return 0;
10    }
11    return ($a > $b)? 1:-1;
12}
13
14$array1 = array("a" => "green", "b" => "Brown", 'c' => 'blue', 0 => 'red');
15$array2 = array("a" => "green", "b" => "Brown", 'c' => 'blue', 0 => 'red');
16
17$result = array_diff_uassoc($array1, $array2, "key_compare_func");
18print_r($result);
19
20?>
21--EXPECT--
22Array
23(
24)
25