Re: [RFC] [Discussion] Shorter Attribute Syntax Change
| From: | Michał Marcin Brzuchalski | Date: | Wed, 29 Jul 2020 18:40:31 +0000 |
| Subject: | Re: [RFC] [Discussion] Shorter Attribute Syntax Change | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111253@lists.php.net to get a copy of this message | ||
Hi Joe,
wt., 28 lip 2020 o 16:47 Joe Ferguson <joe@joeferguson.me> napisał(a):
> Hello Internals,
>
> I've been working with Derick Rethans and others (thanks all!) on a Shorter
> Attribute Syntax Change RFC which outlines reasons why the "#[]" syntax
> would be preferred over the currently agreed upon "@@" syntax for Shorter
> Attribute Syntax.
>
> An important part of the research that went into this proposal demonstrates
> how "@@" will make handling attributes more difficult for PHP_CodeSniffer
> (and similar tools) and shows how the alternative "#[]" syntax is more
> friendly for these tools.
>
> You can find the RFC
> https://wiki.php.net/rfc/shorter_attribute_syntax_change and
> I'm happy to
> answer any questions as best I can.
>
Thank you for bringing this up.
TIL something new about popular framework templating component which I
wanna share with you.
There is already use of @@ in files with ".php" extension in Blade
templates from Laravel framework.
In Laravel 7.x double @@ is used as an escape sequence allowing template
compiler to passthrough
TypeScript expressions with @decorator() which is described in the
Templating section of manual[1].
I realize that it's not the same cause the double @@ is used here inside
".php" files in HTML mode
and not in PHP code mode but since this feature exist it may cause issues
on a text search lookup
using for eg. grep | sed | awk like tools.
TL;DR
Now please bear in mind that I'm just saying that people from Larevil
community already
can use the same syntax with double "@@name()" in ".php" files but outside
of PHP code context.
[1] https://laravel.com/docs/7.x/blade#blade-and-javascript-frameworks
Cheers,
Michał Marcin Brzuchalski