3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array("a" => "green", "red", "red"); $array2 = array("b" => "green", "yellow", "red"); $result = array_diff($array1, $array2); print_r($result); if ($result) { echo 'not empty'; } else { echo 'empty'; } var_dump(array_values($array2));

preferences:
28.61 ms | 402 KiB | 5 Q