cvs: phpdoc /en/reference/errorfunc/functions restore-exception-handler.xml

From: Date: Fri, 31 Oct 2008 01:29:22 +0000
Subject: cvs: phpdoc /en/reference/errorfunc/functions restore-exception-handler.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2348@lists.php.net to get a copy of this message
kalle Fri Oct 31 01:29:22 2008 UTC Modified files: /phpdoc/en/reference/errorfunc/functions restore-exception-handler.xml Log: * New example for restore_exception_handler() http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/errorfunc/functions/restore-exception-handler.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/errorfunc/functions/restore-exception-handler.xml diff -u phpdoc/en/reference/errorfunc/functions/restore-exception-handler.xml:1.7 phpdoc/en/reference/errorfunc/functions/restore-exception-handler.xml:1.8 --- phpdoc/en/reference/errorfunc/functions/restore-exception-handler.xml:1.7 Wed Jun 20 22:24:25 2007 +++ phpdoc/en/reference/errorfunc/functions/restore-exception-handler.xml Fri Oct 31 01:29:22 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry xml:id="function.restore-exception-handler" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>restore_exception_handler</refname> @@ -27,7 +27,43 @@ <para> This function always returns &true;. </para> - </refsect1> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>restore_exception_handler</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + function exception_handler_1(Exception $e) + { + echo '[' . __FUNCTION__ . '] ' . $e->getMessage(); + } + + function exception_handler_2(Exception $e) + { + echo '[' . __FUNCTION__ . '] ' . $e->getMessage(); + } + + set_exception_handler('exception_handler_1'); + set_exception_handler('exception_handler_2'); + + restore_exception_handler(); + + throw new Exception('This triggers the first exception handler...'); +?> +]]> + </programlisting> + </example> + <screen> +<![CDATA[ +[exception_handler_1] This triggers the first exception handler... +]]> + </screen> + </para> + </refsect1> <refsect1 role="seealso"> &reftitle.seealso;

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