Re: Return expression

From: Date: Sat, 07 Feb 2026 22:51:20 +0000
Subject: Re: Return expression
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-130052@lists.php.net to get a copy of this message
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.

« previous php.internals (#130052) next »