Add experimental APIs to get and clear the last exception

This commit is contained in:
Sam Ruby 2000-07-08 10:35:50 +00:00
parent fd3d84ee52
commit ee36612cef
8 changed files with 150 additions and 2 deletions

23
ext/rpc/java/except.php Normal file
View file

@ -0,0 +1,23 @@
<?
$stack=new Java("java.util.Stack");
$stack->push(1);
#
# Should succeed and print out "1"
#
$result = $stack->pop();
$ex = java_last_exception_get();
if (!$ex) print "$result\n";
#
# Should fail - note the "@" eliminates the warning
#
$result=@$stack->pop();
$ex=java_last_exception_get();
if ($ex) print $ex->toString();
#
# Reset last exception
#
java_last_exception_clear();
?>