3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { foreach(range(0, 100000000000) as $foo){echo sprintf('Bonjour %s', $foo);} } catch (Throwable $t) { var_dump($t); }
Output for 8.3.0 - 8.3.4, 8.3.6
object(ValueError)#1 (7) { ["message":protected]=> string(82) "The supplied range exceeds the maximum array size: start=0 end=100000000000 step=1" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/YhXPR" ["line":protected]=> int(3) ["trace":"Error":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/YhXPR" ["line"]=> int(3) ["function"]=> string(5) "range" ["args"]=> array(2) { [0]=> int(0) [1]=> int(100000000000) } } } ["previous":"Error":private]=> NULL }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 object(ValueError)#1 (7) { ["message":protected]=> string(82) "The supplied range exceeds the maximum array size: start=0 end=100000000000 step=1" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/YhXPR" ["line":protected]=> int(3) ["trace":"Error":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/YhXPR" ["line"]=> int(3) ["function"]=> string(5) "range" ["args"]=> array(2) { [0]=> int(0) [1]=> int(100000000000) } } } ["previous":"Error":private]=> NULL }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
object(ValueError)#1 (7) { ["message":protected]=> string(75) "The supplied range exceeds the maximum array size: start=0 end=100000000000" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/YhXPR" ["line":protected]=> int(3) ["trace":"Error":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/YhXPR" ["line"]=> int(3) ["function"]=> string(5) "range" ["args"]=> array(2) { [0]=> int(0) [1]=> int(100000000000) } } } ["previous":"Error":private]=> NULL }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: range(): The supplied range exceeds the maximum array size: start=0 end=100000000000 in /in/YhXPR on line 3 Warning: Invalid argument supplied for foreach() in /in/YhXPR on line 3
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/YhXPR on line 3
Process exited with code 255.

preferences:
163.04 ms | 401 KiB | 198 Q