Re: Annotation PHP 7
| From: | Sebastian B.-Hagensen | Date: | Tue, 04 Nov 2014 21:24:50 +0000 |
| Subject: | Re: Annotation PHP 7 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78685@lists.php.net to get a copy of this message | ||
Just as a note: /** and /* are already treated differently by the
parser (T_DOC_COMMENT vs. T_COMMENT, this difference is also present
in opcache).
Anyway, metadata/annotations/whatever you want to call them should be
seperated from comments and verbal descriptions on a
syntax level, not just by some conventions. It's one of the big
advantages of having them in the core. If your project needs to
support php5 you can still use doc-comments to store such data, even
if php7 gets first class annotations you may still parse the comment
in whichever way you want. By having a native way of defining them,
php would also avoid all possiblities of bc-breaks in libraries
consuming doc-comments.
2014-11-04 22:11 GMT+01:00 Lester Caine <lester@lsces.co.uk>:
> On 04/11/14 20:18, guilhermeblanco@gmail.com wrote:
>> Primarily, I do not see docblocks as the right place to store class'
>> metadata information. Metadata != Comments.
>
> We use comment wrappers in many places to hide secondary material from
> other processes. Just rename docblocks -> metadata ... what is the
> problem? Now expand the docblock key words and one does not have to
> worry about clashes as it's all ring fenced.
>
> Is the material needed at runtime? In which case 'minimize' can strip it
> all. I can even see a case for /** being treated differently to /* and
> // blocks if needs be.
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk
> Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>