3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array_1 = Array( 'car', 'bike', 'plane', 'ship' ); $array2 = Array( 'tiger', 'bike', 'bike_1', 'bike_30', 'bike_clone', 'bike_sold', 'plane', 'plane_3a', 'plane_fly' ); $newArray = array_intersect($array_1, $array2); print_r($newArray);
Output for 4.3.0 - 7.2.0
Array ( [1] => bike [2] => plane )