PHP Try Catch: Basics & Advanced PHP Exception Handling Tutorial
When PHP version 5 was released, it incorporated a built-in model to catch errors and exceptions. Handling errors in PHP with try catch blocks is almost the same as handling errors in other programming languages. When a PHP exception is thrown, the PHP runtime looks for a catch statement that can handle that type of exception. It will continue checking the calling methods up the stack trace until a catch statement is found.