TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
671 B
36 lines
671 B
--TEST--
|
|
ZE2: set_exception_handler()
|
|
--SKIPIF--
|
|
<?php die("skip");?>
|
|
--FILE--
|
|
<?php
|
|
class MyException extends Exception {
|
|
function __construct(public $error) {}
|
|
|
|
function getException()
|
|
{
|
|
return $this->error;
|
|
}
|
|
}
|
|
|
|
function ThrowException()
|
|
{
|
|
throw new MyException("'This is an exception!'");
|
|
}
|
|
|
|
|
|
try {
|
|
} catch (MyException $exception) {
|
|
print "There shouldn't be an exception: " . $exception->getException();
|
|
print "\n";
|
|
}
|
|
|
|
try {
|
|
ThrowException();
|
|
} catch (MyException $exception) {
|
|
print "There was an exception: " . $exception->getException();
|
|
print "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
There was an exception: 'This is an exception!'
|
|
|