3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i = 0; $hitungLoopingObat= 7; do{ $remainder = ($i+1) % 5; echo "The number is " . $i . "\n"; if( $remainder == 0) { echo "new line \n"; } $i++; } while($i <= $hitungLoopingObat); if($remainder > 0){ $loncat = (5 - $remainder)+$hitungLoopingObat; for($j=0; $j<$loncat; $j++) { echo "new line \n"; } }
based on 4qRMX
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.3.0rc3
The number is 0 The number is 1 The number is 2 The number is 3 The number is 4 new line The number is 5 The number is 6 The number is 7 new line new line new line new line new line new line new line new line new line