3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array_1 = Array( [0] => car, [1] => bike, [2] => plane, [3] => ship ); $array2 = Array( [0] => tiger, [1] => bike, [2] => bike_1, [3] => bike_30, [4] => bike_clone, [5] => bike_sold, [6] => plane, [7] => plane_3a, [8] => plane_fly ); $newArray = array_intersect($array_1, $array2); print_r($newArray);
Output for 7.0.0 - 7.1.0
Notice: Use of undefined constant car - assumed 'car' in /in/moXfF on line 5 Warning: Illegal offset type in /in/moXfF on line 5 Notice: Use of undefined constant bike - assumed 'bike' in /in/moXfF on line 6 Warning: Illegal offset type in /in/moXfF on line 6 Notice: Use of undefined constant plane - assumed 'plane' in /in/moXfF on line 7 Warning: Illegal offset type in /in/moXfF on line 7 Notice: Use of undefined constant ship - assumed 'ship' in /in/moXfF on line 8 Warning: Illegal offset type in /in/moXfF on line 8 Notice: Use of undefined constant tiger - assumed 'tiger' in /in/moXfF on line 15 Warning: Illegal offset type in /in/moXfF on line 15 Notice: Use of undefined constant bike - assumed 'bike' in /in/moXfF on line 16 Warning: Illegal offset type in /in/moXfF on line 16 Notice: Use of undefined constant bike_1 - assumed 'bike_1' in /in/moXfF on line 17 Warning: Illegal offset type in /in/moXfF on line 17 Notice: Use of undefined constant bike_30 - assumed 'bike_30' in /in/moXfF on line 18 Warning: Illegal offset type in /in/moXfF on line 18 Notice: Use of undefined constant bike_clone - assumed 'bike_clone' in /in/moXfF on line 19 Warning: Illegal offset type in /in/moXfF on line 19 Notice: Use of undefined constant bike_sold - assumed 'bike_sold' in /in/moXfF on line 20 Warning: Illegal offset type in /in/moXfF on line 20 Notice: Use of undefined constant plane - assumed 'plane' in /in/moXfF on line 21 Warning: Illegal offset type in /in/moXfF on line 21 Notice: Use of undefined constant plane_3a - assumed 'plane_3a' in /in/moXfF on line 22 Warning: Illegal offset type in /in/moXfF on line 22 Notice: Use of undefined constant plane_fly - assumed 'plane_fly' in /in/moXfF on line 23 Warning: Illegal offset type in /in/moXfF on line 23 Array ( )
Output for 5.4.0 - 5.6.28
Notice: Use of undefined constant car - assumed 'car' in /in/moXfF on line 5 Warning: Illegal offset type in /in/moXfF on line 5 Notice: Use of undefined constant bike - assumed 'bike' in /in/moXfF on line 6 Warning: Illegal offset type in /in/moXfF on line 6 Notice: Use of undefined constant plane - assumed 'plane' in /in/moXfF on line 7 Warning: Illegal offset type in /in/moXfF on line 7 Notice: Use of undefined constant ship - assumed 'ship' in /in/moXfF on line 10 Warning: Illegal offset type in /in/moXfF on line 10 Notice: Use of undefined constant tiger - assumed 'tiger' in /in/moXfF on line 15 Warning: Illegal offset type in /in/moXfF on line 15 Notice: Use of undefined constant bike - assumed 'bike' in /in/moXfF on line 16 Warning: Illegal offset type in /in/moXfF on line 16 Notice: Use of undefined constant bike_1 - assumed 'bike_1' in /in/moXfF on line 17 Warning: Illegal offset type in /in/moXfF on line 17 Notice: Use of undefined constant bike_30 - assumed 'bike_30' in /in/moXfF on line 18 Warning: Illegal offset type in /in/moXfF on line 18 Notice: Use of undefined constant bike_clone - assumed 'bike_clone' in /in/moXfF on line 19 Warning: Illegal offset type in /in/moXfF on line 19 Notice: Use of undefined constant bike_sold - assumed 'bike_sold' in /in/moXfF on line 20 Warning: Illegal offset type in /in/moXfF on line 20 Notice: Use of undefined constant plane - assumed 'plane' in /in/moXfF on line 21 Warning: Illegal offset type in /in/moXfF on line 21 Notice: Use of undefined constant plane_3a - assumed 'plane_3a' in /in/moXfF on line 22 Warning: Illegal offset type in /in/moXfF on line 22 Notice: Use of undefined constant plane_fly - assumed 'plane_fly' in /in/moXfF on line 25 Warning: Illegal offset type in /in/moXfF on line 25 Array ( )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/moXfF on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[', expecting ')' in /in/moXfF on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/moXfF on line 5
Process exited with code 255.