Tag Archives: catch

Exception handling in PHP

PHP5 supports exception handling with try and catch blocks. This can be used to notify the user of any exceptions. This example uses a modified version of the Person class of the Inheritance in PHP example to throw an exception if an invalid age has been supplied. The catch block is used to catch the [...]

Posted in PHP | Also tagged , , , , , , , | Leave a comment