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