Re: [RFC] Attributes v2
| From: | Alexandru Pătrănescu | Date: | Wed, 11 Mar 2020 10:52:14 +0000 |
| Subject: | Re: [RFC] Attributes v2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108975@lists.php.net to get a copy of this message | ||
Hi Benjamin,
Two small issues/questions:
1. It is not allowed to use the same attribute name more than once on the
same declaration and a compile error is thrown when this detected.
Is there any reason for this? IMO, the attribute can represents something
that can have multiple options. Like an
Around attribute for aspect
oriented programming for example.
2. for reflection classes extended with the getAttributes() methods, I
think we need to add ReflectionMethod or change ReflectionFunction with
ReflectionFunctionAbstract.
Alex
On Mon, Mar 9, 2020 at 4:43 PM Benjamin Eberlei <kontakt@beberlei.de> wrote:
> Hi all,
>
> I want to resurrect Dmitrys Attributes RFC that was rejected for 7.1 in
> 2016 with a few changes, incorporating feedback from the mailing list back
> then and from talking to previous no voters.
>
> The RFC is at https://wiki.php.net/rfc/attributes_v2
>
> A working patch is at
> https://github.com/beberlei/php-src/pull/2 though
> work around the details is still necessary.
>
> The RFC contains a section with common criticism and objections to
> attributes, and I hope to have collected and responded to a good amount
> already from previous discussions.
>
> There is also a fair amount of implementation detail still up for debate,
> which is noted in "Open Issues". I have pre-committed to one approach, but
> listed alternatives there. On these issues I am looking for your feedback.
>
> greetings
> Benjamin
>