Re: [RFC] Context Managers
| From: | Arnaud Le Blanc | Date: | Wed, 12 Nov 2025 16:23:54 +0000 |
| Subject: | Re: [RFC] Context Managers | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129208@lists.php.net to get a copy of this message | ||
Hi Derick,
> > On Wed, Nov 5, 2025, at 1:38 AM, Deleu wrote:
> >
> > > Out of curiosity, what happens if GOTO is used inside a context
> > > block to jump away from it?
> >
> > That would be a success case, just like break or return. Basically
> > anything other than an exception is a success case. (That said,
> > please don't use Goto. :-) )
>
> I do think you might need special attention to this case, as jumping out
> of loops (such as foreach) needs to be handled with care.
In this case, goto is supported out of the box as anything necessary
to cleanup after with() is emitted in a finally block. So goto will
execute this before jumping to the actual target.
Best Regards,
Arnaud