3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array(1,2,3,4); $array2 = array(1,4); $leftovers = array_diff($array1, $array2); var_dump($leftovers);
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.26, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
array(2) { [1]=> int(2) [2]=> int(3) }