From 68563fe6a3cdae681f1158c424848a46fcac7223 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Fri, 22 Jun 2001 05:56:56 +0000 Subject: [PATCH] Added exception handling example. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@49985 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/java.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/functions/java.xml b/functions/java.xml index 63aaef8394..07ac83ea28 100644 --- a/functions/java.xml +++ b/functions/java.xml @@ -181,6 +181,32 @@ exception java_last_exception_get + + The following example demonstrates the usage of Java's exception + handler from within PHP: + + + +pop(); + $ex = java_last_exception_get(); + if (!$ex) print "$result\n"; + + // This should fail (error suppressed by @) + $result = @$stack->pop(); + $ex = java_last_exception_get(); + if ($ex) print $ex->toString(); + + // Clear last exception + java_last_exception_clear(); +?> + + +