3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $labels = array("1","2","3","4","5","6"); foreach($labels as $label) { $labels_array[] = $label['name']; } for($i=0;$i<count($labels_array);$i++) { echo($labels_array[$i]); if($i % 2 == 0) { echo("\n"); }else{echo(",");} } ?>
Output for 5.4.0 - 7.1.0
Warning: Illegal string offset 'name' in /in/0joOm on line 4 Warning: Illegal string offset 'name' in /in/0joOm on line 4 Warning: Illegal string offset 'name' in /in/0joOm on line 4 Warning: Illegal string offset 'name' in /in/0joOm on line 4 Warning: Illegal string offset 'name' in /in/0joOm on line 4 Warning: Illegal string offset 'name' in /in/0joOm on line 4 1 2,3 4,5 6,
Output for 4.3.0 - 5.3.29
1 2,3 4,5 6,