2020-04-07 10:52:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
function Foo(): int {
|
|
|
|
throw new \Exception('error');
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
2020-04-07 11:25:43 +00:00
|
|
|
Foo();
|
2020-04-07 10:52:42 +00:00
|
|
|
} catch (\BarException | \BazException $e) {
|
|
|
|
echo "bar or baz exception " . $e->getMessage() . "\n";
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
echo "other exception " . $e->getMessage() . "\n";
|
|
|
|
} finally {
|
|
|
|
echo "finally";
|
|
|
|
}
|