diff --git a/language/exceptions.xml b/language/exceptions.xml index 6d62306446..b90eb7132d 100644 --- a/language/exceptions.xml +++ b/language/exceptions.xml @@ -1,21 +1,29 @@ - + Exceptions PHP 5 has an exception model similar to that of other programming languages. - An exception can be thrown, try and caught within PHP. A Try block must - include at least one catch block. Multiple catch blocks can be used to - catch different classtypes; execution will continue after that last catch - block defined in sequence. Exceptions can be thrown within catch blocks. + An exception can be thrown, and caught + ("catched") within PHP. Code may be surrounded in a + try block, to facilitate the catching of potential + exceptions. Each try must have at least one + corresponding catch block. Multiple + catch blocks can be used to catch different classes of + exeptions. Normal execution (when no exception is thrown within the + try block, or when a catch matching + the thrown exception's class is not present) will continue after that last catch + block defined in sequence. Exceptions can be thrown (or + re-thrown) within a catch block. When an exception is thrown, code following the statement will not be - executed and PHP will attempt to find the first matching catch block. If an - exception is not caught a PHP Fatal Error will be issued with an Uncaught - Exception message, unless there has been a handler defined with - set_exception_handler. + executed, and PHP will attempt to find the first matching + catch block. If an + exception is not caught, a PHP Fatal Error will be issued with an + "Uncaught Exception ..." message, unless a handler has + been defined with set_exception_handler. Throwing an Exception @@ -102,7 +110,7 @@ class MyException extends Exception parent::__construct($message, $code); } - // custom string representation of object */ + // custom string representation of object public function __toString() { return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; }