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;) { 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">456</div><div class="row">789</div><div class="row">101112</div><div class="row">131415</div><div class="row">161718</div><div class="row">192021</div><div class="row">222324</div><div class="row">252627</div><div class="row">282930</div><div class="row">313233</div><div class="row">343536</div><div class="row">373839</div><div class="row">404142</div><div class="row">434445</div><div class="row">464748</div><div class="row">495051</div><div class="row">525354</div><div class="row">555657</div><div class="row">585960</div><div class="row">616263</div><div class="row">646566</div><div class="row">676869</div><div class="row">707172</div><div class="row">737475</div><div class="row">767778</div><div class="row">798081</div><div class="row">828384</div><div class="row">858687</div><div class="row">888990</div><div class="row">919293</div><div class="row">949596</div><div class="row">979899</div><div class="row">100</div>