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_ukey($array1, $array2, "key_compare_func"); print_r($result);
based on hvT1m
Output for 5.2.6 - 7.1.0
Array ( [b] => brown [c] => blue )
Output for 5.1.0 - 5.2.5
Array ( [b] => brown [c] => blue [0] => red )
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function array_diff_ukey() in /in/taaP2 on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_diff_ukey() in /in/taaP2 on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_diff_ukey() in /in/taaP2 on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_diff_ukey() in /in/taaP2 on line 12