Re: [RFC] [Discussion] Ad d ReflectionAttribute::getCurrent()
| From: | Derick Rethans | Date: | Mon, 04 May 2026 20:40:15 +0000 |
| Subject: | Re: [RFC] [Discussion] Ad d ReflectionAttribute::getCurrent() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-130767@lists.php.net to get a copy of this message | ||
On 4 May 2026 21:24:39 BST, Daniel Scherzer <daniel.e.scherzer@gmail.com> wrote:
>Hi internals,
>
>I'd like to start the discussion for a new RFC about adding a new method,
>ReflectionAttribute::getCurrent(), to access the current reflection target
>of an attribute.
>
>* RFC: https://wiki.php.net/rfc/reflectionattribute-getcurrent
"a new static method, ReflectionAttribute::getCurrent(), that, when called from an attribute
constructor, returns a reflection object corresponding to what the attribute was applied to."
This sounds like an arbitrary new rule for just this functionality. I don't think we should
have special rules for a single static method call.
I believe it's useful to have something like this, but I'm not in favour of this approach.
Would it not be possible for this to be a normal (dynamic) method on the ReflectionAttrbute object?
cheers
Derick