3v4l.org

run code in 500+ PHP versions simultaneously
<?php $max = 130; $output = []; $current = 0; while($current <= $max) { if ($current < 100) { $current += 5; } else { $current += 25; } // Make sure we do not add anything above the current max (e.g. max = 120, current = 110 + 25 = 135) if ($current > $max) { break; } $output[] = $current; } print_r($output);
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.32, 8.3.0 - 8.3.33, 8.4.1 - 8.4.24, 8.5.0 - 8.5.9
Array ( [0] => 5 [1] => 10 [2] => 15 [3] => 20 [4] => 25 [5] => 30 [6] => 35 [7] => 40 [8] => 45 [9] => 50 [10] => 55 [11] => 60 [12] => 65 [13] => 70 [14] => 75 [15] => 80 [16] => 85 [17] => 90 [18] => 95 [19] => 100 [20] => 125 )

preferences:
118.57 ms | 1503 KiB | 4 Q