3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $columns = 6; $rows = 4; $i = 1; $s = $columns - 1; for ($x = 0; $x < $columns * $rows; $x++) { if ($x % $columns == 0) echo PHP_EOL; echo $i; if ($x > 0 && $x % $s == 0) { $s = ceil($s / 2) - 1; $i++; } }
based on 7WK4G
Output for 7.0.0 - 7.2.0
111111 23 Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /in/HtnaB:11 Stack trace: #0 {main} thrown in /in/HtnaB on line 11
Process exited with code 255.
Output for 5.3.19 - 5.6.28
111111 23 Warning: Division by zero in /in/HtnaB on line 11 4567 8910111213 141516171819