3v4l.org

run code in 300+ PHP versions simultaneously
<? ini_set('memory_limit', '6400000M'); ini_set('display_errors', 1); error_reporting(E_ALL); $sec1 = 2122396090000914537739 - 2122334690000166340863; echo "$sec1"; echo "<br>"; // array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) foreach (range(2122334690000166340863, 2122396090000914537739) as $number) { echo $number,'<br />'; } ?>
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
<? ini_set('memory_limit', '6400000M'); ini_set('display_errors', 1); error_reporting(E_ALL); $sec1 = 2122396090000914537739 - 2122334690000166340863; echo "$sec1"; echo "<br>"; // array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) foreach (range(2122334690000166340863, 2122396090000914537739) as $number) { echo $number,'<br />'; } ?>
Output for 8.0.13
6.1400000748061E+16<br> Fatal error: Uncaught ValueError: The supplied range exceeds the maximum array size: start=2122334690000166453248 end=2122396090000914513920 in /in/dMPRF:11 Stack trace: #0 /in/dMPRF(11): range(2.1223346900002E+21, 2.1223960900009E+21) #1 {main} thrown in /in/dMPRF on line 11
Process exited with code 255.
Output for 7.0.0 - 7.0.32, 7.1.0 - 7.1.24, 7.2.0 - 7.2.12, 7.3.32 - 7.3.33, 7.4.33
6.1400000748061E+16<br> Warning: range(): The supplied range exceeds the maximum array size: start=2122334690000166453248 end=2122396090000914513920 in /in/dMPRF on line 11 Warning: Invalid argument supplied for foreach() in /in/dMPRF on line 11
Output for 5.5.17, 5.6.0 - 5.6.38
6.1400000748061E+16<br> Fatal error: Out of memory (allocated 260046848) (tried to allocate 32 bytes) in /in/dMPRF on line 11
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.16, 5.5.18 - 5.5.38
6.1400000748061E+16<br> Fatal error: Out of memory (allocated 260833280) (tried to allocate 32 bytes) in /in/dMPRF on line 11
Process exited with code 255.

preferences:
225.94 ms | 402 KiB | 337 Q