Re: [RFC] Attributes v2
| From: | Benjamin Eberlei | Date: | Tue, 10 Mar 2020 19:49:44 +0000 |
| Subject: | Re: [RFC] Attributes v2 | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108961@lists.php.net to get a copy of this message | ||
On Tue, Mar 10, 2020 at 5:30 PM Mike Schinkel <mike@newclarity.net> wrote:
> > On Mar 10, 2020, at 11:28 AM, Benjamin Eberlei <kontakt@beberlei.de>
> wrote:
> >
> > Just to make sure you don't run in circles in this discussion thread
> here, even when syntax is not fixed yet, it's not going to be a syntax
> where the attributes are suffixed after the declaration. It would maybe
> some other characters like %[Attr].
> >
>
> It is your RFC so you are the arbiter.
>
> One final on syntax: Can I suggest you consider @:Attr?
>
> -Mike
> P. S. Did you see the question on interfaces?
>
>
No I missed it. Attributes work on interfaces, but they are not inherited
to parent classes. This is similar to how a class implementing an interface
may have different docblocks. You can use the reflection api to get to
interfaces from a class and check for their attributes there. For traits
the attributes get copied into the using class.