On Wed, Dec 26, 2012 at 5:48 PM, Yussuf Khalil <d...@pp3345.de> wrote:
> Hello, > > assuming that you are referring to the RFC about annotations ( > https://wiki.php.net/rfc/**annotations<https://wiki.php.net/rfc/annotations>) > I don't think that annotations are needed in PHP. Declarations that > actually have an impact on the language itself (like deprecated) should > rather be implemented as function modifiers while annotations with simple > information (like <Author("Mr. X")>) can also be stored in the doc comment > (as @author Mr. X). However, I see that Reflection methods like > getAnnotation() and hasAnnotation() can be useful sometimes. We could > implement methods that fetch information from the doc comment for these > cases, for example getDocTag($name) and hasDocTag($name). > >> On Wed, Dec 26, 2012 at 4:22 PM, Yussuf Khalil <d...@pp3345.de> wrote: >> >> Hello, >>> >>> I have created an RFC about adding a deprecated modifier for functions in >>> PHP, see >>> https://wiki.php.net/rfc/****deprecated-modifier<https://wiki.php.net/rfc/**deprecated-modifier> >>> <https://**wiki.php.net/rfc/deprecated-**modifier<https://wiki.php.net/rfc/deprecated-modifier> >>> >. >>> >>> What are your thoughts on this? >>> >>> Thank you, >>> Yussuf Khalil >>> >>> -- >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >>> Hi! >> I think the idea of marking functions as deprecated is great and the >> current way of throwing E_DEPRECATED error by trigger_error can be >> improved. In the current state. >> >> That's being said, I don't think that adding a deprecated keyword is the >> solution, since now we can write documentation and set a "@deprecated" >> mark. >> I think, that the best solution is the attributes concept that was >> rejected >> before and should be re-considered after the last releases changes and >> language improvements. >> A few built in attributes, such as <Deprecated> can be great. >> >> What do you think? >> >> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > The point of adding a methods to get annotations from the docblock is good for itself and I think that we should create RFC about it. However, I do think that because annotations gives you to execute custom code it has pros that the deprecated keyword or any other keyword can't gives you. Because it's not a discussion about annotation and I've suggested it as an alternative I'll back to the topic. I have to agree with Eugene and Nikita since as I see it, the current implementation has limitation that trigger_error solve. In addition, even now when using modern IDE and setting @deprecated annotation in the docblock you can see a warning when calling this method, so I don't see much reason to add a keyword just for that.