<?php
function exception_error_handler($severity, $message, $file, $line) {
if (!(error_reporting() & $severity)) {
// This error code is not included in error_reporting
return;
}
throw new ErrorException($message, 0, $severity, $file, $line);
}
set_error_handler("exception_error_handler");
echo $a;
Fatal error: Uncaught ErrorException: Undefined variable $a in /in/CpsPS:13
Stack trace:
#0 /in/CpsPS(13): exception_error_handler(2, 'Undefined varia...', '/in/CpsPS', 13)
#1 {main}
thrown in /in/CpsPS on line 13
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
Fatal error: Uncaught ErrorException: Undefined variable $a in /in/CpsPS:13
Stack trace:
#0 /in/CpsPS(13): exception_error_handler(2, 'Undefined varia...', '/in/CpsPS', 13)
#1 {main}
thrown in /in/CpsPS on line 13
Process exited with code 255.
Fatal error: Uncaught ErrorException: Undefined variable: a in /in/CpsPS:13
Stack trace:
#0 /in/CpsPS(13): exception_error_handler(8, 'Undefined varia...', '/in/CpsPS', 13, Array)
#1 {main}
thrown in /in/CpsPS on line 13
Process exited with code 255.
Fatal error: Uncaught exception 'ErrorException' with message 'Undefined variable: a' in /in/CpsPS:13
Stack trace:
#0 /in/CpsPS(13): exception_error_handler(8, 'Undefined varia...', '/in/CpsPS', 13, Array)
#1 {main}
thrown in /in/CpsPS on line 13
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Fatal error: Uncaught exception 'ErrorException' with message 'Undefined variable: a' in /in/CpsPS:13
Stack trace:
#0 /in/CpsPS(13): exception_error_handler()
#1 {main}
thrown in /in/CpsPS on line 13
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'ErrorException' not found in /in/CpsPS on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/CpsPS on line 8
Process exited with code 255.