3v4l.org

run code in 300+ PHP versions simultaneously
<?php register_shutdown_function(function () { $error = error_get_last(); if ($error !== null) { throw new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']); } }); try { ini_set('memory_limit',1); $a = range(1,100000); } catch (Throwable $e) { echo "Caught: ".$e; }
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: Failed to set memory limit to 1 bytes (Current memory usage is 2097152 bytes) in /in/AQWMC on line 12 Fatal error: Uncaught ErrorException: Failed to set memory limit to 1 bytes (Current memory usage is 2097152 bytes) in /in/AQWMC:12 Stack trace: #0 [internal function]: {closure}() #1 {main} thrown in /in/AQWMC on line 12
Process exited with code 255.
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 Warning: Failed to set memory limit to 1 bytes (Current memory usage is 2097152 bytes) in /in/AQWMC on line 12 Fatal error: Uncaught ErrorException: Failed to set memory limit to 1 bytes (Current memory usage is 2097152 bytes) in /in/AQWMC:12 Stack trace: #0 [internal function]: {closure}() #1 {main} thrown in /in/AQWMC on line 12
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 4194312 bytes) in /in/AQWMC on line 13 Fatal error: Uncaught ErrorException: Allowed memory size of 2097152 bytes exhausted (tried to allocate 4194312 bytes) in /in/AQWMC:13 Stack trace: #0 [internal function]: {closure}() #1 {main} thrown in /in/AQWMC on line 13
Process exited with code 255.

preferences:
170.36 ms | 403 KiB | 207 Q