Re: [RFC[ Property accessor hooks, take 2
| From: | Alexandru Pătrănescu | Date: | Tue, 27 Feb 2024 21:22:05 +0000 |
| Subject: | Re: [RFC[ Property accessor hooks, take 2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122527@lists.php.net to get a copy of this message | ||
On Wed, Feb 21, 2024, 20:58 Larry Garfield <larry@garfieldtech.com> wrote:
> Hello again, fine Internalians.
>
> After much on-again/off-again work, Ilija and I are back with a more
> polished property access hooks/interface properties RFC.
>
I liked how the discussion and the RFC evolved so far and that we have less
magic now.
I didn't saw one aspect discussed, automatic detection if a property is
virtual or not.
Why not using explicit keyword for marking a property as virtual and not
relying on the detection?
Detection cannot be complete, and I can think if the property is used in
another method called from the hook, we might end up with errors when
extracting few lines of code as a method.
Since in the reflection the "virtual" name is used, it would be natural and
simple to have it explicitly as part of the property definition.
Of course, a virtual property would require at least a hook type defined,
otherwise there wouldn't be any point for its existence.
Alex