cvs: phpdoc-hu /language exceptions.xml
[email protected] ("Lajos Cseppent?")
| Newsgroups | php.doc.hu |
|---|---|
| Message-ID | <cvschappy1187363576@cvsserver> |
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>