Re: [VOTE] Shorter Attribute Syntax Change
| From: | Larry Garfield | Date: | Tue, 11 Aug 2020 20:08:46 +0000 |
| Subject: | Re: [VOTE] Shorter Attribute Syntax Change | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111484@lists.php.net to get a copy of this message | ||
On Tue, Aug 11, 2020, at 11:54 AM, Theodore Brown wrote:
> On Tue, Aug 11, 2020 at 11:36 AM Rowan Tommins <rowan.collins@gmail.com> wrote:
> What will you grep for if you want to find all places where the Route
> attribute is used (but not some other class named Route)?
I'd go to the Route attribute class in my IDE, right click, and select "find usages."
I'll be honest, 75% of the points made in this thread seem spurious to me, regardless of which
syntax they're supporting. (FTR, I don't have an especially strong opinion either way
other than marginally liking having a closing sigil.)
For the BC potential of #[], as a library author it doesn't make much difference to me. I will
likely add attribute support to Tukio soon after PHP 8 is released, but I'll just be reading
from the Reflection API if available, in addition to the existing mechanisms I have in place. Which
syntax a given listener uses (<<>>, @@, @[], #[], etc.) doesn't matter at that
point, only the reflection API does. So opt-in attribute support can happen regardless of the
syntax.
(I know, I'm one of the people who pointed out the BC potential of #[] previously, but at least
for the use cases i can foresee it's not actually relevant.)
--Larry Garfield