3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [0, 1, 2, 3, 4, 5, 6]; $b = [4]; print_r(array_udiff($a, $b, function($x, $y) { return $x <=> $y; })); print_r(array_udiff($a, $b, function($x, $y) { return $x == $y ? 0 : 1; }));
based on 8rOn0
Output for 7.0.0 - 7.2.0
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [5] => 5 [6] => 6 ) Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 )
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected '>' in /in/AfvgC on line 7
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/AfvgC on line 3
Process exited with code 255.