cvs: phpdoc /en/language exceptions.xml

From: Date: Fri, 18 Apr 2008 19:18:42 +0000
Subject: cvs: phpdoc /en/language exceptions.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-1529@lists.php.net to get a copy of this message
felipe Fri Apr 18 19:18:42 2008 UTC Modified files: /phpdoc/en/language exceptions.xml Log: - Added new example http://cvs.php.net/viewvc.cgi/phpdoc/en/language/exceptions.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/language/exceptions.xml diff -u phpdoc/en/language/exceptions.xml:1.5 phpdoc/en/language/exceptions.xml:1.6 --- phpdoc/en/language/exceptions.xml:1.5 Sun Aug 26 08:24:32 2007 +++ phpdoc/en/language/exceptions.xml Fri Apr 18 19:18:42 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <chapter xml:id="language.exceptions" xmlns="http://docbook.org/ns/docbook"> <title>Exceptions</title> @@ -58,7 +58,43 @@ ]]> </screen> </example> + <example> + <title>Nested Exception</title> + <programlisting role="php"> +<![CDATA[ +<?php + +class MyException extends Exception { } + +class Test { + public function testing() { + try { + try { + throw new MyException('foo!'); + } catch (MyException $e) { + /* rethrow it */ + throw $e; + } + } catch (Exception $e) { + var_dump($e->getMessage()); + } + } +} + +$foo = new Test; +$foo->testing(); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +string(4) "foo!" +]]> + </screen> + </example> + <sect1 xml:id="language.exceptions.extending"> <title>Extending Exceptions</title> <para>

« previous php.doc.cvs (#1529) next »