sean Wed Dec 28 19:09:27 2005 EDT
Modified files:
/phpdoc/en/language exceptions.xml
Log:
better flow/grammar
http://cvs.php.net/viewcvs.cgi/phpdoc/en/language/exceptions.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/language/exceptions.xml
diff -u phpdoc/en/language/exceptions.xml:1.1
phpdoc/en/language/exceptions.xml:1.2
--- phpdoc/en/language/exceptions.xml:1.1 Wed Dec 29 12:46:06 2004
+++ phpdoc/en/language/exceptions.xml Wed Dec 28 19:09:27 2005
@@ -1,21 +1,29 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<chapter id="language.exceptions">
<title>Exceptions</title>
<para>
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 <literal>throw</literal>n, and caught
+ ("<literal>catch</literal>ed") within PHP. Code may be surrounded in a
+ <literal>try</literal> block, to facilitate the catching of potential
+ exceptions. Each <literal>try</literal> must have at least one
+ corresponding <literal>catch</literal> block. Multiple
+ <literal>catch</literal> blocks can be used to catch different classes of
+ exeptions. Normal execution (when no exception is thrown within the
+ <literal>try</literal> block, or when a <literal>catch</literal> matching
+ the thrown exception's class is not present) will continue after that last
catch
+ block defined in sequence. Exceptions can be <literal>throw</literal>n (or
+ re-thrown) within a <literal>catch</literal> block.
</para>
<para>
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
- <function>set_exception_handler</function>.
+ executed, and PHP will attempt to find the first matching
+ <literal>catch</literal> block. If an
+ exception is not caught, a PHP Fatal Error will be issued with an
+ "<literal>Uncaught Exception ...</literal>" message, unless a handler has
+ been defined with <function>set_exception_handler</function>.
</para>
<example>
<title>Throwing an Exception</title>
@@ -102,7 +110,7 @@
parent::__construct($message, $code);
}
- // custom string representation of object */
+ // custom string representation of object
public function __toString() {
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}