Hey! That's why I am against this RFC or any other "change style to what I prefer". PHP's current attribute syntax is consistent with other languages and poses no BC breaks whatsoever.
Best regards, Benas On Thu, Jun 4, 2020, 1:37 PM Ilija Tovilo <tovilo.il...@gmail.com> wrote: > > > Does the PHP parser prevent us from adopting #[attr]? I presume C#'s > [attr] > > > syntax and C++'s [[attr]] are impossible due to PHP's short array > syntax. > > > > yes, that would create ambiguity in the parser since `#` (just like `//`) > > is for comments. > > I've mentioned this off-list before. If we consider @@ with a BC break > we could also consider #[] by making #[ a symbol. > This is also a breaking change but a probably similarly small one. It > would break code like this: > > # Comments still work > #[ <-- But they can't start with #[ > > To me both of those look acceptable but #[ looks nicer (but that's > just my personal preference). > > Ilija > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >