3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $itemList = array( array(0), array(1), array(0,1), array(0,1,2,3,4), array(new stdClass), array(new stdClass, new stdClass), array(new stdClass, new stdClass, new stdClass) ); function doCompare($a, $b) { if ($a === $b) { return 0; } elseif ($a > $b) { return 1; } return -1; }; foreach ($itemList as $item) { var_dump(array_udiff($item, $item, 'doCompare')); }
based on gmC8i
Output for 5.0.0 - 7.1.0
array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(0) { }
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_udiff() in /in/6j4qG on line 24
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_udiff() in /in/6j4qG on line 24
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_udiff() in /in/6j4qG on line 24