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.
26 lines
530 B
26 lines
530 B
--TEST--
|
|
finally can use caught exception variable when catch rethrows
|
|
--FILE--
|
|
<?php
|
|
|
|
function main(): void
|
|
{
|
|
try {
|
|
$a = 1;
|
|
throw new RuntimeException('test');
|
|
return;
|
|
} catch (Throwable $e) {
|
|
echo 'Caught exception: ', $e->getMessage(), "\n";
|
|
throw $e;
|
|
} finally {
|
|
var_dump($a);
|
|
echo 'Finally exception: ', $e->getMessage(), "\n";
|
|
}
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Caught exception: test
|
|
int(1)
|
|
Finally exception: test
|
|
|
|
Fatal error: Uncaught RuntimeException: test in %A
|
|
|