3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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));
based on 4BZJ2
Output for 4.3.0 - 5.6.26, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
Array ( ) emptyarray(3) { [0]=> string(5) "green" [1]=> string(6) "yellow" [2]=> string(3) "red" }