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){ var_dump($a, $b); return $a === $b; }; foreach ($itemList as $item) { var_dump(array_udiff($item, $item, 'doCompare')); }
based on JlDk2
Output for 7.0.0 - 7.1.0
int(0) int(0) array(1) { [0]=> int(0) } int(1) int(1) array(1) { [0]=> int(1) } int(0) int(1) int(0) int(1) int(0) int(0) int(0) int(1) int(0) int(1) array(0) { } int(0) int(1) int(1) int(2) int(2) int(3) int(3) int(4) int(0) int(1) int(1) int(2) int(2) int(3) int(3) int(4) int(0) int(0) int(0) int(1) int(0) int(1) int(1) int(2) int(2) int(3) int(3) int(4) array(0) { } object(stdClass)#1 (0) { } object(stdClass)#1 (0) { } array(1) { [0]=> object(stdClass)#1 (0) { } } object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } object(stdClass)#2 (0) { } object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } array(0) { } object(stdClass)#4 (0) { } object(stdClass)#5 (0) { } object(stdClass)#5 (0) { } object(stdClass)#6 (0) { } object(stdClass)#4 (0) { } object(stdClass)#5 (0) { } object(stdClass)#5 (0) { } object(stdClass)#6 (0) { } object(stdClass)#4 (0) { } object(stdClass)#4 (0) { } object(stdClass)#4 (0) { } object(stdClass)#5 (0) { } object(stdClass)#4 (0) { } object(stdClass)#5 (0) { } object(stdClass)#5 (0) { } object(stdClass)#6 (0) { } array(0) { }
Output for hhvm-3.10.0 - 3.12.0
int(0) int(0) array(1) { [0]=> int(0) } int(1) int(1) array(1) { [0]=> int(1) } int(1) int(0) int(0) int(0) int(1) int(0) array(1) { [0]=> int(0) } int(2) int(1) int(4) int(2) int(2) int(0) int(3) int(2) int(4) int(3) int(1) int(0) int(0) int(2) int(1) int(2) int(2) int(2) int(2) int(0) int(3) int(2) int(4) int(2) array(0) { } object(stdClass)#1 (0) { } object(stdClass)#1 (0) { } array(1) { [0]=> object(stdClass)#1 (0) { } } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } object(stdClass)#2 (0) { } object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } array(1) { [0]=> object(stdClass)#2 (0) { } } object(stdClass)#5 (0) { } object(stdClass)#4 (0) { } object(stdClass)#6 (0) { } object(stdClass)#5 (0) { } object(stdClass)#4 (0) { } object(stdClass)#5 (0) { } object(stdClass)#5 (0) { } object(stdClass)#5 (0) { } object(stdClass)#5 (0) { } object(stdClass)#4 (0) { } object(stdClass)#6 (0) { } object(stdClass)#5 (0) { } array(0) { }
Output for 5.0.0 - 5.6.28
int(0) int(0) array(1) { [0]=> int(0) } int(1) int(1) array(1) { [0]=> int(1) } int(1) int(0) int(1) int(0) int(1) int(1) int(1) int(0) int(1) int(0) array(0) { } int(2) int(1) int(4) int(2) int(2) int(0) int(3) int(2) int(4) int(3) int(1) int(0) int(2) int(1) int(4) int(2) int(2) int(0) int(3) int(2) int(4) int(3) int(1) int(0) int(4) int(4) int(4) int(3) int(4) int(3) int(3) int(2) int(2) int(1) int(1) int(0) array(0) { } object(stdClass)#1 (0) { } object(stdClass)#1 (0) { } array(1) { [0]=> object(stdClass)#1 (0) { } } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } object(stdClass)#3 (0) { } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } object(stdClass)#2 (0) { } array(0) { } object(stdClass)#5 (0) { } object(stdClass)#4 (0) { } object(stdClass)#6 (0) { } object(stdClass)#5 (0) { } object(stdClass)#5 (0) { } object(stdClass)#4 (0) { } object(stdClass)#6 (0) { } object(stdClass)#5 (0) { } object(stdClass)#6 (0) { } object(stdClass)#6 (0) { } object(stdClass)#6 (0) { } object(stdClass)#5 (0) { } object(stdClass)#6 (0) { } object(stdClass)#5 (0) { } object(stdClass)#5 (0) { } object(stdClass)#4 (0) { } array(0) { }
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_udiff() in /in/P5fTH on line 19
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_udiff() in /in/P5fTH on line 19
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_udiff() in /in/P5fTH on line 19