3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array("a_b_c"); $array2 = array("a","c","d","e"); $promotion = explode($array1, "_"); foreach($promotion as $promo) { if(in_array($promo,$array2)) { print_r($promo); } }
Output for 5.3.1 - 5.6.28, 7.0.0 - 7.1.0
Warning: explode() expects parameter 1 to be string, array given in /in/jGN5Q on line 8 Warning: Invalid argument supplied for foreach() in /in/jGN5Q on line 10
Output for hhvm-3.12.0
Warning: explode() expects parameter 1 to be string, array given in /in/jGN5Q on line 8 Warning: Invalid argument supplied for foreach() in /in/jGN5Q on line 16
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.3.0
Notice: Array to string conversion in /in/jGN5Q on line 8