3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a1= array(0 => array("id"=>1,"name"=>"cat 1"), 1 => array("id"=>2,"name"=>"cat 2"), 2 => array("id"=>3,"name"=>"cat 1") ); $a2 = array(0 => array("id"=>1,"name"=>"cat 1")); $result=array_intersect($a1,$a2); print_r($result);
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Array ( [0] => Array ( [id] => 1 [name] => cat 1 ) [1] => Array ( [id] => 2 [name] => cat 2 ) [2] => Array ( [id] => 3 [name] => cat 1 ) )
Output for hhvm-3.10.0 - 3.12.0
Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Notice: Array to string conversion in /in/VlpjI on line 9 Array ( [0] => Array ( [id] => 1 [name] => cat 1 ) [1] => Array ( [id] => 2 [name] => cat 2 ) [2] => Array ( [id] => 3 [name] => cat 1 ) )
Output for 4.3.0 - 5.3.29
Array ( [0] => Array ( [id] => 1 [name] => cat 1 ) [1] => Array ( [id] => 2 [name] => cat 2 ) [2] => Array ( [id] => 3 [name] => cat 1 ) )