3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function key_compare_func($a, $b) { var_dump($a, $b );exit; if ($a === $b) { return 0; } return ($a > $b)? 1:-1; } $array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red"); $array2 = array("a" => "green", "yellow", "red"); $result = array_diff_uassoc($array1, $array2, "key_compare_func"); print_r($result);
Output for 7.0.0 - 7.3.0alpha1
string(1) "a" string(1) "b"
Output for hhvm-3.15.4
int(0) string(1) "a"
Output for 5.6.0 - 5.6.30
string(1) "b" string(1) "a"