Re: [RFC] Shorter Attribute Syntax Change RFC 0.2
| From: | Andreas Leathley | Date: | Wed, 19 Aug 2020 09:01:27 +0000 |
| Subject: | Re: [RFC] Shorter Attribute Syntax Change RFC 0.2 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111623@lists.php.net to get a copy of this message | ||
On 19.08.20 10:47, Benjamin Eberlei wrote:
One last change that I didn't see yesterday as it was on Github and not this list is the addition of another syntax proposal @{} with the same benefits as @[], a little more snowflake than compared to other languages, but without the BC Break.I mentioned the benefits of @{} in an email to this list on Monday, with the proposal to have both @@ and @{} as attribute syntax, so both camps could have their syntax (one with delimiters, one without) with minimal BC breaks, and leave the decision to the PHP developers/projects what they prefer in what circumstances, because there can be valid reasons to use both - I probably would use both. @{} could be good to define multiple attributes for classes/properties, @@ could be good for short attributes or ones very entrenched within the code, like function parameters. The @{} syntax could be amended in the future, so this would also be "future-proof". But I guess the division about syntax is too big at this point to consider an approach where we just offer both types of syntax. From a PHP developer viewpoint, it would be preferable though.