3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ["1","2"]; $b = ["2",3=>[]]; $out = array_udiff($a, $b, function($c, $d) { static $i = 0; echo ++$i. @": $c != $d= ".@$c != @$d.PHP_EOL; return $c != $d; }); var_dump($out);
based on aULfj
Output for 7.0.0 - 7.3.0beta1
1 Notice: Array to string conversion in /in/M7YHd on line 7 1 Notice: Array to string conversion in /in/M7YHd on line 7 111array(1) { [0]=> string(1) "1" }
Output for 5.4.12 - 5.6.28
1 Notice: Array to string conversion in /in/M7YHd on line 7 11 Notice: Array to string conversion in /in/M7YHd on line 7 11array(2) { [0]=> string(1) "1" [1]=> string(1) "2" }
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/M7YHd on line 3
Process exited with code 255.