3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function myfunction_key($a,$b) { if ($a===$b) { return 0; } return ($a>$b)?1:-1; } function myfunction_value($a,$b) { var_dump($a,$b); if ($a===$b) { return 0; } return ($a>$b)?1:-1; } $a1=array("a"=>"red","b"=>"green","c"=>"blue"); $a2=array("a"=>"red","b"=>"green","c"=>"green"); $result=array_udiff_uassoc($a1,$a2,"myfunction_key","myfunction_value");die; print_r($result);
based on o2qbZ
Output for 7.0.0 - 7.1.0
string(1) "a" string(1) "b" string(1) "b" string(1) "c" string(1) "a" string(1) "b" string(1) "b" string(1) "c" string(1) "a" string(1) "a" string(1) "b" string(1) "a" string(1) "b" string(1) "b" string(1) "c" string(1) "a" string(1) "c" string(1) "b" string(1) "c" string(1) "c"
Output for hhvm-3.10.0 - 3.12.0
string(1) "b" string(1) "a" string(1) "c" string(1) "b" string(1) "a" string(1) "b" string(1) "a" string(1) "a" string(1) "a" string(1) "a" string(1) "b" string(1) "b" string(1) "b" string(1) "b" string(1) "c" string(1) "b" string(1) "c" string(1) "c" string(1) "c" string(1) "c"
Output for 5.2.6 - 5.6.28
string(1) "b" string(1) "a" string(1) "c" string(1) "b" string(1) "b" string(1) "a" string(1) "c" string(1) "b" string(1) "a" string(1) "a" string(1) "b" string(1) "a" string(1) "b" string(1) "b" string(1) "c" string(1) "a" string(1) "c" string(1) "b" string(1) "c" string(1) "c"
Output for 5.0.0 - 5.2.5
string(1) "b" string(1) "a" string(1) "c" string(1) "b" string(1) "b" string(1) "a" string(1) "c" string(1) "b" string(1) "a" string(1) "a" string(1) "b" string(1) "a" string(1) "b" string(1) "b" string(1) "c" string(1) "b" string(1) "c" string(1) "c"
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_udiff_uassoc() in /in/vDMRZ on line 24
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_udiff_uassoc() in /in/vDMRZ on line 24
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_udiff_uassoc() in /in/vDMRZ on line 24