mirror of
https://github.com/php/php-src.git
synced 2024-11-26 11:23:47 +08:00
24 lines
423 B
PHP
24 lines
423 B
PHP
<?
|
|
$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();
|
|
?>
|