3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( array('id' => 0, 'name' => 'foo'), array('id' => 1, 'name' => 'bar') ); $b = array( array('id' => 0, 'name' => 'foo'), array('id' => 2, 'name' => 'baz') ); $intersect = array_intersect($a, $b); var_dump($intersect);
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 array(2) { [0]=> array(2) { ["id"]=> int(0) ["name"]=> string(3) "foo" } [1]=> array(2) { ["id"]=> int(1) ["name"]=> string(3) "bar" } }
Output for hhvm-3.10.0 - 3.12.0
Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 Notice: Array to string conversion in /in/YlOM7 on line 12 array(2) { [0]=> array(2) { ["id"]=> int(0) ["name"]=> string(3) "foo" } [1]=> array(2) { ["id"]=> int(1) ["name"]=> string(3) "bar" } }
Output for 4.3.0 - 5.3.29
array(2) { [0]=> array(2) { ["id"]=> int(0) ["name"]=> string(3) "foo" } [1]=> array(2) { ["id"]=> int(1) ["name"]=> string(3) "bar" } }