3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = range(1,100); $i = 0; $total = count($array); for ($i = 0; $i < $total; $i++) { echo '<div class="row">'; for ($e = $i; $e < $i + 3 && $e < $total; $e++) { echo $array[$e]; } $i = $e; echo '</div>'; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<div class="row">123</div><div class="row">567</div><div class="row">91011</div><div class="row">131415</div><div class="row">171819</div><div class="row">212223</div><div class="row">252627</div><div class="row">293031</div><div class="row">333435</div><div class="row">373839</div><div class="row">414243</div><div class="row">454647</div><div class="row">495051</div><div class="row">535455</div><div class="row">575859</div><div class="row">616263</div><div class="row">656667</div><div class="row">697071</div><div class="row">737475</div><div class="row">777879</div><div class="row">818283</div><div class="row">858687</div><div class="row">899091</div><div class="row">939495</div><div class="row">979899</div>