cvs: phpdoc-hu /language exceptions.xml

From: Date: Fri, 17 Aug 2007 15:12:56 +0000
Subject: cvs: phpdoc-hu /language exceptions.xml
Groups: php.doc.hu 
Request: Send a blank email to doc-hu+get-1645@lists.php.net to get a copy of this message
chappy Fri Aug 17 15:12:56 2007 UTC Modified files: /phpdoc-hu/language exceptions.xml Log: sync http://cvs.php.net/viewvc.cgi/phpdoc-hu/language/exceptions.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-hu/language/exceptions.xml diff -u phpdoc-hu/language/exceptions.xml:1.3 phpdoc-hu/language/exceptions.xml:1.4 --- phpdoc-hu/language/exceptions.xml:1.3 Sat Jun 23 13:37:27 2007 +++ phpdoc-hu/language/exceptions.xml Fri Aug 17 15:12:56 2007 @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="iso-8859-2"?> -<!-- EN-Revision: 1.3 Maintainer: chappy Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: chappy Status: ready --> +<!-- Reviewed: no --> <chapter xml:id="language.exceptions" xmlns="http://docbook.org/ns/docbook"> <title>Kivételek (Exceptions)</title> @@ -27,15 +28,18 @@ <programlisting role="php"> <![CDATA[ <?php -try { - $error = 'Mindig küldd el ezt a hibát'; - throw new Exception($error); - - // A köv. kód már nem fut le. - echo 'Sose fut le'; +function inverse($x) { + if (!$x) { + throw new Exception('Division by zero.'); + } + else return 1/$x; +} +try { + echo inverse(5) . "\n"; + echo inverse(0) . "\n"; } catch (Exception $e) { - echo 'Elkapott kivétel: ', $e->getMessage(), "\n"; + echo 'Caught exception: ', $e->getMessage(), "\n"; } // Futás folytatása @@ -43,7 +47,15 @@ ?> ]]> </programlisting> - </example> + &example.outputs; + <screen> +<![CDATA[ +0.2 +Division by zero. +Hello World +]]> + </screen> + </example> <sect1 xml:id="language.exceptions.extending"> <title>Kivételek kiterjesztése</title>

« previous php.doc.hu (#1645) next »