Pedro Cordeiro wrote on 25/11/2015 16:53:
Rowan, even if they are not harder, there is no reason to keep this feature in docblocks.

Well, I can think of one reason: backwards compatibility. I don't mean with current frameworks - as you say, these are not currently standardised, so some will need to be adapted whatever is implemented in core - but with older versions of PHP.

If we invent new syntax, then any code using that feature must *require* the version of PHP that introduces that syntax, because previous versions will simply throw a syntax error. There are a few ways around this, such as:

- allowing the annotation to be preceded by // as Sara suggested (or maybe #, to make it look like a C pre-processor directive) - using some other syntax that is currently a no-op, like ECMAScript's wacky "use strict"

But ultimately, these end up having the same disadvantages you're claiming for docblocks - they look like things you can delete, or which has some other purpose, but are actually vital to the operation of the code.#

I don't feel that strongly in favour of docblocks, but I don't think the reasons given against are particularly strong.

Regards,
--
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to