3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function key_compare_func($a, $b) { var_dump($a, $b); 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_ukey($array1, $array2, "key_compare_func"); die; print_r($result);
based on 8Dl5c
Output for 7.0.0 - 7.2.0
string(1) "a" string(1) "b" string(1) "b" string(1) "c" string(1) "a" int(0) int(0) int(1) string(1) "a" string(1) "a" string(1) "b" string(1) "a" string(1) "b" int(0) string(1) "b" int(1) string(1) "c" string(1) "a" string(1) "c" int(0) string(1) "c" int(1)
Output for 5.2.6 - 5.6.28
string(1) "b" string(1) "a" string(1) "c" string(1) "b" int(0) string(1) "a" int(1) int(0) string(1) "a" int(0) string(1) "a" string(1) "a" string(1) "b" string(1) "a" string(1) "b" int(0) string(1) "b" int(1) string(1) "c" string(1) "a" string(1) "c" int(0) string(1) "c" int(1)
Output for 5.1.0 - 5.2.5
string(1) "b" string(1) "a" string(1) "c" string(1) "b" int(0) string(1) "a" int(1) int(0) string(1) "a" int(0) string(1) "a" string(1) "a" string(1) "b" string(1) "a" string(1) "b" int(0) string(1) "c" int(0)
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function array_diff_ukey() in /in/IAO0Z 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/IAO0Z 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/IAO0Z 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/IAO0Z on line 12