On Tue, Aug 11, 2020 at 11:36 AM Rowan Tommins <rowan.coll...@gmail.com> wrote:

> On Tue, 11 Aug 2020 at 17:07, Theodore Brown <theodor...@outlook.com> wrote:
> 
> > > > fact that the @@ syntax makes attributes easier to grep for.
> >
> > This can be a simple Yes or No. With @@ or @: you can type those
> > symbols followed by the attribute name to grep for it. With the other
> > syntaxes and attribute grouping, if the name isn't unique it may be
> > difficult to search for since you can't rely on a unique leading symbol.
> 
> Surely *all* of the syntaxes will be easily greppable once adopted, because
> any instances that aren't attributes will have to be fixed (other than
> those in comments and strings, which can happen with any of them).

I think you may have misunderstood my point - it's not so much about
the leading symbols but about grouping. Consider the following example:

    @[
        Jit,
        Route("/api/posts/{id}", methods: ["GET", "HEAD"]),
    ]
    public function show(int $id) { ... }

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)?

With the @@ syntax you can easily grep for "@@Route" to find all the
places where specifically the attribute is used:

    @@Jit
    @@Route("/api/posts/{id}", methods: ["GET", "HEAD"])
    public function show(int $id) { ... }

Best regards,  
Theodore
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to