3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i = 0; $header = 0; $hitungLoopingObat= 9; do{ $remainder = ($i+1) % 5; $head = ($remainder+$i) % 5; $head_total = count($head); if($remainder == 1) echo "Header " .$header++. "\n"; echo "Obat Ke " . $head_total . "\n"; if( $remainder == 0) { echo "new line \n"; } $i++; } while($i <= $hitungLoopingObat); if($remainder > 0){ $loncat = (5 - $remainder)+1; for($j=0; $j<$loncat; $j++) { echo "Sisa New Line " .$loncat. "\n"; } }
based on d9o7R
Output for 7.2.0 - 7.3.0rc3
Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Header 0 Obat Ke 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Obat Ke 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Obat Ke 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Obat Ke 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Obat Ke 1 new line Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Header 1 Obat Ke 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Obat Ke 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Obat Ke 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Obat Ke 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/lIsT5 on line 12 Obat Ke 1 new line
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.1.20
Header 0 Obat Ke 1 Obat Ke 1 Obat Ke 1 Obat Ke 1 Obat Ke 1 new line Header 1 Obat Ke 1 Obat Ke 1 Obat Ke 1 Obat Ke 1 Obat Ke 1 new line