Re: [RFC] Optional Catch Block Body
| From: | Alexandre Daubois | Date: | Thu, 31 Jul 2025 06:50:52 +0000 |
| Subject: | Re: [RFC] Optional Catch Block Body | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128327@lists.php.net to get a copy of this message | ||
> Of course, empty catch blocks are bad practice in most cases. But this particular proposal is
> not intended to encourage these bad practices. I'm just suggesting that you don't have to
> write an extra boiler plate at the syntax level in situations where it's necessary.
From what I can tell, it's very rare to have empty catch blocks, and
even more being done rightfully. I'd be very suspicious if I came
across such code.
I think the extra boilerplate is actually a good thing, showing the
explicit intent to not catch the error. I get that the proposal is not
intended to encourage such a thing, but I agree with Ayesh: it would
definitely will.