3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pagcurrent = 1; $paglast = 1023; $pagesToDisplay = 10; $start = $pagcurrent; if($start >= $pagesToDisplay) $start = $start - ($paglast % $pagesToDisplay); $end = $start + $pagesToDisplay; for ($i = $start; $i < $end; $i++) { echo "$i\n"; }

Abusive script

This script was stopped while abusing our resources

Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.9 - 7.3.29, 7.4.0 - 7.4.22, 8.0.0 - 8.0.8, 8.1.24 - 8.1.29, 8.2.11 - 8.2.23, 8.3.0 - 8.3.11
1 2 3 4 5 6 7 8 9 10
Output for 7.3.0 - 7.3.8

Process exited with code 137.

preferences:
98.18 ms | 406 KiB | 5 Q