That might just work, but it's still close to currently possible code.
Why don't we use something that would currently produce a parse error
and is not as close to valid code
as the examples above?
<<< Annotation('abc'), foo >>> // Used <<< as it's different from
T_SL, but it works for hack, so maybe drop a <>
class DEF {}
comes to mind.
2014-11-12 18:23 GMT+01:00 Marcio Almada <[email protected]>:
>> One problem with using *just* array syntax, without any new keyword or
>> symbols,
>> is that it is extremely close to being existing valid syntax. This may well
>> cause problems in the parser,
>> and would certainly be confusing to users.
>
> Not sure how sacred is `$`, but it could be a good candidate for the
> annotation identifier since it denotes "something that carries a
> value":
>
> $['package.annotation' => ['name' => 'foo']];
> class Foo {
> }
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php