Re: [RFC] [DISCUSSION] Immutable/final/readonly properties
| From: | Máté Kocsis | Date: | Sat, 07 Mar 2020 21:25:33 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Immutable/final/readonly properties | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108892@lists.php.net to get a copy of this message | ||
TL;DR; I plan to open the vote on Monday because the proposal feels complete
for me. Read more to find out why I think so.
Nicolas, do you have any specific use-case in mind that would require a
workaround
outlined in my previous email above the current possibilities (lazy
initialization,
unsetting before first write)?
At first, I wasn't entirely sure if we really need additional reflection
methods, but after
a quick chat with Nikita, I'm even less so. Furthermore, it seems that
ProxyManager
will be able to work together with my proposal in its current form, so I
fail to see
what use-case would need more special treatment? Doctrine maybe? Although I
am
not very familiar with it, using
ReflectionClass::newInstanceWithoutConstructor()
could work around the limitations imposed by write-once properties.
That said, I'd like to start the vote on Monday if no major issues emerge
meanwhile,
because the proposal feels complete now and I can't think of any specific
use-case
that would be blocked by write-once properties. Of course, if we yet find
any, we can
always add support for additional reflection-based workarounds later.
Máté