3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Arrays to hold the numbers for this demo $arr1 = array(5,6,7,8); $arr2 = array(2,5,6); $arr3 = array_values(array_diff($arr1, $arr2)); // Correct result but in wrong positions in the array var_dump($arr3); // array(2) { [2]=> int(7) [3]=> int(8) } ?>

preferences:
27.47 ms | 402 KiB | 5 Q