3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function key_compare_func($a, $b) { var_dump($a, $b);die; if ($a === $b) { return 0; } return ($a > $b)? 1:-1; } $array1 = array("a" => "green", "b" => "brown", "c" => "red"); $array2 = array("a" => "green", "yellow", "red"); $result = array_diff_uassoc($array1, $array2, "key_compare_func"); print_r($result);
based on J4T1F
Output for 7.0.0 - 7.1.0
string(1) "a" string(1) "b"
Output for hhvm-3.10.0 - 3.12.0
int(0) string(1) "a"
Output for 5.0.0 - 5.6.28
string(1) "b" string(1) "a"
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_diff_uassoc() in /in/l6pYG on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_diff_uassoc() in /in/l6pYG on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_diff_uassoc() in /in/l6pYG on line 12