get_exception_handlerGets the user-defined exception handler function
&reftitle.description;
callablenullget_exception_handler
Returns the current exception handler function, if any.
&reftitle.parameters;
&no.function.parameters;
&reftitle.returnvalues;
Returns the currently defined exception handler.
If no handler is defined, &null; is returned.
The returned handler is the exact callable value that was passed to
set_exception_handler to define it.
&reftitle.examples;
get_exception_handler example
getMessage() . "\n";
};
var_dump(get_exception_handler()); // NULL
set_exception_handler($handler);
var_dump(get_exception_handler() === $handler); // bool(true)
?>
]]>
&reftitle.notes;
Prior to PHP 8.5.0, this functionality can be provided by the following
polyfill:
]]>
&reftitle.seealso;
set_exception_handlerrestore_exception_handlerrestore_error_handlererror_reportingExceptions