PHP set_exception_handler() function

The set_exception_handler() is an inbuilt function of PHP and is used to sets a user-defined exception handler function. It will returns the name of the previously defined exception handler, or NULL on error. If no previous handler was defined, NULL is also returned.

PHP set_exception_handler() function example

Example #1 set_exception_handler() function example

Example #2 set_exception_handler() function example

If you want a class instance to handle the exception, this is how you do it.


If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts: