3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tab1 = array(10,13,15,18); $tab2 = array(13,10,18,23); $merge = array_intersect($tab1, $tab2); $merge2 = array_intersect($tab2, $tab1); echo '<pre>'.print_r($merge,true).'</pre>'; echo '<pre>'.print_r($merge2,true).'</pre>';
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre>Array ( [0] => 10 [1] => 13 [3] => 18 ) </pre><pre>Array ( [0] => 13 [1] => 10 [2] => 18 ) </pre>