Re: Annotation PHP 7
| From: | Stas Malyshev | Date: | Tue, 04 Nov 2014 18:17:28 +0000 |
| Subject: | Re: Annotation PHP 7 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78661@lists.php.net to get a copy of this message | ||
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.