Re: Annotation PHP 7
| From: | Marcio Almada | Date: | Tue, 04 Nov 2014 18:30:07 +0000 |
| Subject: | Re: Annotation PHP 7 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78664@lists.php.net to get a copy of this message | ||
> Reading it -
> http://doctrine-common.readthedocs.org/en/latest/reference/annotations.html
> -
> it looks pretty big - strictly typed values, named
> parameters, default constructors linked to properties, support for enum
> types, support for typed arrays, separate constant syntax within
> annotations. These are all features not supported in PHP, and it seems a
> bit weird to me to have mini-language inside PHP that would support
> these. And, of course, arbitrary depth recursive annotations, and for
> some reason separate array syntax using {} and not [].
From my point of view, most of this complexity is accidental.
This happened mostly because, of course, we couldn't have parser /
runtime errors
inside doc comments. Once we have core annotations, oustide of doc comments,
mostly of the DSL described in
http://doctrine-common.readthedocs.org/en/latest/reference/annotations.html
becomes unnecessary.
2014-11-04 15:17 GMT-03:00 Stas Malyshev <smalyshev@gmail.com>:
> Hi!
>
>> All projects mentioned in this thread use:
>>
>> http://doctrine-common.readthedocs.org/en/latest/reference/annotations.html
>> That makes a pretty good base spec.
> Reading it, it looks pretty big - strictly typed values, named
> parameters, default constructors linked to properties, support for enum
> types, support for typed arrays, separate constant syntax within
> annotations. These are all features not supported in PHP, and it seems a
> bit weird to me to have mini-language inside PHP that would support
> these. And, of course, arbitrary depth recursive annotations, and for
> some reason separate array syntax using {} and not [].
> Moreover, there's extensive checking for annotations with exceptions
> thrown if any of the above doesn't typecheck - I'm not even sure where
> that would fit in PHP parser.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>