Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-17 Thread Dmitry Stogov
On Tue, Feb 17, 2015 at 4:50 PM, François Laupretre franc...@php.net wrote: HI Dmitry, Question : in which scope do you evaluate the PHP expression ? We don't evaluate expressions. We just store them. Evaluation and/or modification is a subject for future development. Example :

RE: [PHP-DEV] Re: Annotations in PHP7

2015-02-17 Thread François Laupretre
HI Dmitry, Question : in which scope do you evaluate the PHP expression ? Example : DbC.requires($a 0); DbC.ensures(__RETURN__ 0); function foo($a) { ... How can you know from this that the first expression must be evaluated at function entry, that the second one must be interpreted when

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Rowan Collins
On Mon, Feb 16, 2015 at 6:41 PM, Rowan Collins rowan.coll...@gmail.com mailto:rowan.coll...@gmail.com wrote: Is there any value in deciding the initial syntax for 7.0, and implementing only non-parameterised annotations, i.e. you can call hasAnnotation(string): bool but nothing else?

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
this will work, of course, and robust implementation wouldn't take more than a day :) but it'll require user-level parser again. no big advantage in comparison to doc-block. Thanks. Dmitry. On Mon, Feb 16, 2015 at 6:41 PM, Rowan Collins rowan.coll...@gmail.com wrote: Nikita Popov wrote on

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
this won't implement features necessary for phpDocumentor, Doctrine, etc. On Mon, Feb 16, 2015 at 8:29 PM, Rowan Collins rowan.coll...@gmail.com wrote: On Mon, Feb 16, 2015 at 6:41 PM, Rowan Collins rowan.coll...@gmail.com mailto:rowan.coll...@gmail.com wrote: Is there any value in

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Rowan Collins
Dmitry Stogov wrote on 16/02/2015 18:41: this won't implement features necessary for phpDocumentor, Doctrine, etc. I know. Like I say, it's just a way of keeping things moving, rather than saying eh, maybe next year. It allows us to formally agree the feature, the roadmap, the basic

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Rafael Dohms
On Mon, Feb 16, 2015 at 7:41 PM, Dmitry Stogov dmi...@zend.com wrote: this won't implement features necessary for phpDocumentor, Doctrine, etc. Just be careful here with phpDocumentor, it does not use annotations but really needs docblocks instead. Today the overlap between it and doctrine and

RE: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread François Laupretre
Hi Dmitry, In my mind, annotation syntax was one level lower, dealing with strings of unknown syntax, not PHP expressions. Something like : '*' whitespaces '@' STRING free-string-up-to-eol This supports : * @requires $a 0 But also : * @statement INSERT INTO ?? VALUES (13, 'Phoenix', 'AZ',

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
On Tue, Feb 17, 2015 at 6:45 AM, François Laupretre franc...@php.net wrote: Hi Dmitry, In my mind, annotation syntax was one level lower, dealing with strings of unknown syntax, not PHP expressions. Something like : '*' whitespaces '@' STRING free-string-up-to-eol This supports : *

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
you already have doc-block. nothing should be done in PHP core, but you have to parse it yourself. The goal of annotations is to provide standard and powerful way. On the other hand standard PHP expression syntax may be not enough for all cases. Thanks. Dmitry. On Mon, Feb 16, 2015 at 2:22 PM,

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Cesar Rodas
On 16/02/15 12:32, Dmitry Stogov wrote: you already have doc-block. nothing should be done in PHP core, but you have to parse it yourself. The goal of annotations is to provide standard and powerful way. On the other hand standard PHP expression syntax may be not enough for all cases.

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
yes. like it was proposed at https://wiki.php.net/rfc/reflection_doccomment_annotations#list_of_methods_to_implement Thanks. Dmitry. On Mon, Feb 16, 2015 at 2:34 PM, Cesar Rodas ce...@rodas.me wrote: On 16/02/15 12:32, Dmitry Stogov wrote: you already have doc-block. nothing should be done