Re: Annotations in PHP7

From: Date: Mon, 16 Feb 2015 12:07:36 +0000
Subject: Re: Annotations in PHP7
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-82826@lists.php.net to get a copy of this message
2015-02-16 14:19 GMT+03:00 Dmitry Stogov <dmitry@zend.com>: > annotations ::= { annotation }. > annotation ::= '<' STRING '>' | '<' STRING > '(' expr ')' '>'. > > where <expr> is regular PHP expression. Hello! Really like this syntax, actually you steal my thoughts )) I want to call this metadata, not an annotations. Just key-value storage for any top-level elements (namespaces, classes, functions, methods, properties, etc). Value can by anything, acceptable by PHP parser, then it will be possible to provide an API to get this AST node "as-is" and to add a logic layer on top of this. (I'm still waiting for the RFC karma) For annotations, it should be possible to use <<ClassName::class>> constant. Additionally, nested metadata should be supported. Thanks!

« previous php.internals (#82826) next »