3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(array(1,2,3),array(4,5,6)); $b = array(array(4,5,6)); var_dump(array_intersect($a, $b), array_intersect($b, $a));
based on lhZOH
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 array(2) { [0]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } [1]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } } array(1) { [0]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } }
Output for hhvm-3.10.0 - 3.12.0
Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 Notice: Array to string conversion in /in/BKg4P on line 4 array(2) { [0]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } [1]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } } array(1) { [0]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } }
Output for 4.3.0 - 5.3.29
array(2) { [0]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } [1]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } } array(1) { [0]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } }