3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array("a" => "green", "red", "blue", "red"); $array2 = array("b" => "green", "yellow", "red"); $result = array_diff($array1, $array2); print_r($result);print_r($array1);print_r($array2);
Output for 4.3.0 - 7.1.0
Array ( [1] => blue ) Array ( [a] => green [0] => red [1] => blue [2] => red ) Array ( [b] => green [0] => yellow [1] => red )