Re: [RFC] Optional Catch Block Body
| From: | Mihail Liahimov | Date: | Wed, 06 Aug 2025 11:34:34 +0000 |
| Subject: | Re: [RFC] Optional Catch Block Body | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128405@lists.php.net to get a copy of this message | ||
Hi!
At the moment, I can suggest this syntax:
try {
// do something
} catch (SomeIgnorableException) finally {
// do something
}
I also generally like the above idea with the keyword ignore.
чт, 31 июл. 2025 г. в 20:24, Casper Langemeijer <langemeijer@php.net>:
>
>
> On Thu, Jul 31, 2025, at 06:53, Mihail Liahimov wrote:
>
> Proposal
>
> Allow the following syntax where the curly braces can be omitted when no
> exception variable is specified and no handling is needed:
>
> try {
> // code that may throw
> } catch (SomeError);
>
>
> Can you write out how this would interoperate with the finally keyword?
>