Sorry; thought I'd acknowledged this already.

On 2026-02-03 05:00, Ilija Tovilo wrote:

I encountered similar issues for block expressions, for which
{ return; } is effectively equivalent to return. I explained the
problem in more detail here:

https://wiki.php.net/rfc/match_blocks#technical_implications_of_control_statements

Ilija

Thank you for that. If abandoning a function mid-statement can leave things dangling then that's a big no-no. I suppose exceptions can get away with it because there's an opportunity to clean up danglers left by the (possibly multiple) abandoned functions if and when they're caught or while the stack's being unwound.

Reply via email to