3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $images = range(1, 24); foreach ($images as $i => $image) { if ($i % 6 === 0) { echo "-- row-open"; } echo sprintf(" [ %d ] ", $image); if ($i % 6 === 0) { echo "-- row-close\n"; } }
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
-- row-open [ 1 ] -- row-close [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] -- row-open [ 7 ] -- row-close [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] -- row-open [ 13 ] -- row-close [ 14 ] [ 15 ] [ 16 ] [ 17 ] [ 18 ] -- row-open [ 19 ] -- row-close [ 20 ] [ 21 ] [ 22 ] [ 23 ] [ 24 ]
Output for hhvm-3.10.0

Process exited with code 153.