3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array(1 => "green", 2 => "red", 4=> 'yellow'); $array2 = array(1=>'roxo', 2 => "green", 3 => "yellow", 4=>'blue', 5=> "red"); $result = array_intersect($array1, $array2); print_r($result);
based on 1Tr6d
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [1] => green [2] => red [4] => yellow )