Re: [RFC] Context Managers
| From: | Niels Dossche | Date: | Wed, 05 Nov 2025 21:02:57 +0000 |
| Subject: | Re: [RFC] Context Managers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129094@lists.php.net to get a copy of this message | ||
Hi
Is the keyword "with" reserved, semi-reserved, ... ?
Asking because I've seen global "with" functions before, like in Laravel for example.
What really is a footgun of the resource type is that they can represent an illegal state.
This proposal leans into having close functions (or equivalent) for resources/objects that make it
possible to represent such illegal state; something I'm fundamentally against.
As an aside, under "Rejected Features", there's a false statement:
> Destructors are not always called immediately when the refcount hits zero.
Kind regards
Niels