Re: [RFC] Optional Catch Block Body
| From: | Andreas Heigl | Date: | Wed, 06 Aug 2025 11:50:18 +0000 |
| Subject: | Re: [RFC] Optional Catch Block Body | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128407@lists.php.net to get a copy of this message | ||
Hey Mihail
Am 06.08.25 um 13:34 schrieb Mihail Liahimov:
Attachment: [application/pgp-signature] OpenPGP digital signature OpenPGP_signature.asc
Hi! At the moment, I can suggest this syntax: try { // do something } catch (SomeIgnorableException) finally { // do something } I find that ... challengingWhen reading the code I now have to go to the end of the line to understand that the second // do something does not belong to the
try but to the finally...
And
try {
// break stuff
} catch (SomeIgnorableException)
finally {
// do something regardless
}
seems boken due to the missing }
But well....
We just have to adapt to something like this:
try {
// break stuff
}
catch (SomeIgnorableException)
catch (Some OtherIgnorableException)
finally {
// do something regardless
}
--
,,,
(o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl |
| mailto:andreas@heigl.org N
50°22'59.5" E 08°23'58" |
| https://andreas.heigl.org
|
+---------------------------------------------------------------------+
| https://hei.gl/appointmentwithandreas
|
+---------------------------------------------------------------------+
| GPG-Key: https://hei.gl/keyandreasheiglorg
|
+---------------------------------------------------------------------+
Attachment: [application/pgp-signature] OpenPGP digital signature OpenPGP_signature.asc