Re: [RFC][Discussion] use construct (Block Scoping)
| From: | Edmond Dantes | Date: | Sun, 09 Nov 2025 18:22:55 +0000 |
| Subject: | Re: [RFC][Discussion] use construct (Block Scoping) | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129176@lists.php.net to get a copy of this message | ||
Hello.
> If the stated problems are a problem in practice or if they are mostly theoretical.
Accidental retention of objects in unpredictable situations is a
constant issue for applications that do not terminate after each
request.
> Possible solutions to the problems (such as the “WeakReference capturing of arguments”).
As a rule, any error can be fixed, but that is not an argument in this
situation. A developer can certainly solve a problem if they are aware
of it. The issue is that if you rely on references, they might never
even realize it exists :)
The problem is not fixing the error, but how easy it is to detect it.
> If the described problem even exists or if it is based on a misunderstanding of either the RFC
> or PHP's existing behavior.
Wasn’t the example above convincing?
---
Best regards
Ed