Re: Annotation PHP 7

From: Date: Wed, 12 Nov 2014 18:29:56 +0000
Subject: Re: Annotation PHP 7
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-78887@lists.php.net to get a copy of this message
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 <marcio.web2@gmail.com>: >> 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 >

« previous php.internals (#78887) next »