<? // require php4compat.php4 here! /* try */ { $error = 'Always throw this error'; throw (new Exception($error)); // Code following an exception is not executed. echo 'Never executed'; } if (catch('Exception', $e)) { echo 'Caught exception: ', $e->getMessage(), "<br>"; } // Continue execution echo 'Hello World';