3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $names = array('Bill', 'Ben', 'Bert', 'Ernie'); $start = 2; foreach( array_merge( array_slice($names, $start), array_slice( $names)) as $name){ echo $name; }
Output for 5.2.6 - 5.6.28, 7.0.0 - 7.1.0
Warning: array_slice() expects at least 2 parameters, 1 given in /in/YaZMo on line 5 Warning: array_merge(): Argument #2 is not an array in /in/YaZMo on line 5 Warning: Invalid argument supplied for foreach() in /in/YaZMo on line 5
Output for hhvm-3.10.0 - 3.12.0
Warning: array_slice() expects at least 2 parameters, 1 given in /in/YaZMo on line 5 Warning: Invalid operand type was used: expects array(s) in /in/YaZMo on line 5 Warning: Invalid argument supplied for foreach() in /in/YaZMo on line 7
Output for 5.0.0 - 5.2.5
Warning: Wrong parameter count for array_slice() in /in/YaZMo on line 5 Warning: array_merge(): Argument #2 is not an array in /in/YaZMo on line 5 Warning: Invalid argument supplied for foreach() in /in/YaZMo on line 5
Output for 4.3.0 - 4.4.9
Warning: Wrong parameter count for array_slice() in /in/YaZMo on line 5 BertErnie