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.
29 lines
873 B
29 lines
873 B
--TEST--
|
|
try-catch-finally: finally block must execute when exception is re-thrown inside catch block. Verifies that finally can access the caught exception variable ($e) even when the catch block re-throws it.
|
|
--FILE--
|
|
<?php
|
|
function main() {
|
|
try {
|
|
$a = 1;
|
|
throw new RuntimeException('test');
|
|
return 0; // trigger bug
|
|
} catch (\Throwable $e) {
|
|
echo 'Caught exception: ', $e->getMessage(), "\n";
|
|
throw $e;
|
|
} finally {
|
|
var_dump($a);
|
|
echo 'Finally exception: ', $e->getMessage(), "\n";
|
|
}
|
|
var_dump('This should not be reached');
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Caught exception: test
|
|
int(1)
|
|
Finally exception: test
|
|
|
|
Fatal error: Uncaught RuntimeException: test in Unknown(0) : eval():1
|
|
Stack trace:
|
|
#0 Unknown(0) : eval()(1): main()
|
|
#1 {main}
|
|
thrown in Unknown(0) : eval() on line 1
|
|
|