3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function key_compare_func($a, $b) { 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);
based on BVdHg
Output for 5.0.0 - 7.1.0
Array ( [b] => brown [c] => blue [0] => red )
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_diff_uassoc() in /in/J4T1F 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/J4T1F 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/J4T1F on line 12