3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); ini_set('display_errors', 0); var_dump(ini_get('display_errors')); var_dump(ini_get('error_reporting')); //set_error_handler('custHandler'); register_shutdown_function('shutdownHandler'); echo $meow['llama']; function custHandler($errno, $errstr, $errfile, $errline, $errcontext) { echo "Custom handler called."; } function shutdownHandler() { echo "I died."; var_dump(error_get_last()); } $data = ''; while(true) { $data .= str_repeat('#', PHP_INT_MAX); }
Output for 7.0.20, 7.1.5 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
string(1) "0" string(5) "32767" I died.array(4) { ["type"]=> int(1) ["message"]=> string(93) "Allowed memory size of 67108864 bytes exhausted (tried to allocate 9223372036854775839 bytes)" ["file"]=> string(9) "/in/q4s6R" ["line"]=> int(27) }
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 8.0.13
string(1) "0" string(5) "32767" I died.array(4) { ["type"]=> int(1) ["message"]=> string(94) "Allowed memory size of 134217728 bytes exhausted (tried to allocate 9223372036854775839 bytes)" ["file"]=> string(9) "/in/q4s6R" ["line"]=> int(27) }
Process exited with code 255.
Output for 5.4.0 - 5.4.31
string(1) "0" string(5) "32767" I died.array(4) { ["type"]=> int(1) ["message"]=> string(93) "Allowed memory size of 67108864 bytes exhausted (tried to allocate 9223372036854775808 bytes)" ["file"]=> string(9) "/in/q4s6R" ["line"]=> int(27) }
Process exited with code 255.
Output for 5.3.0 - 5.3.28
string(1) "0" string(5) "30719" I died.array(4) { ["type"]=> int(1) ["message"]=> string(93) "Allowed memory size of 67108864 bytes exhausted (tried to allocate 9223372036854775808 bytes)" ["file"]=> string(9) "/in/q4s6R" ["line"]=> int(27) }
Process exited with code 255.

preferences:
187.45 ms | 401 KiB | 251 Q