logo
logo
Sign in

PHP Try Catch Basics & Advanced PHP Exception Handling Tutorial

avatar
Tech Mekrz
PHP Try Catch Basics & Advanced PHP Exception Handling Tutorial

When a PHP exception is thrown, the PHP runtime looks for a catch statement that can handle that type of exception.

If one is not found, the exception is handed to the global exception handler that we will also cover in this article.

// run your code here

//code to handle the exception

//optional code that always runs

The following keywords are used for PHP exception handling.

collect
0
avatar
Tech Mekrz
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more