Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64441 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59603 invoked from network); 26 Dec 2012 22:12:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Dec 2012 22:12:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=g.b.yahav@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=g.b.yahav@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.172 as permitted sender) X-PHP-List-Original-Sender: g.b.yahav@gmail.com X-Host-Fingerprint: 209.85.214.172 mail-ob0-f172.google.com Received: from [209.85.214.172] ([209.85.214.172:61428] helo=mail-ob0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/91-43002-9467BD05 for ; Wed, 26 Dec 2012 17:12:25 -0500 Received: by mail-ob0-f172.google.com with SMTP id za17so8333861obc.31 for ; Wed, 26 Dec 2012 14:12:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=lumbpvKhnOyz6vwfRLtDLHWSb6UbxuW6vSPcUrYQ/io=; b=U80n6+y0pyefFbYyQEnxYOgNde2JH9djR4VzFe3y/JPdT4cih1EpmzWRGovMU3BDi6 Kq5bzffz/Tnh/xmTZYB1PCQv0PKEpXHvrJmH38fx9NxP/FGo44AJGU9UoYkCCYQsbfLn KcEnj3B++K/x+9iXktFV7RpIE2gBxU9StYHdnmpy/NGCMko4Kfp0piGR/LPvS/08eU/R 3uN4gnYmt4hTwSwiLSoJlK0+TKTlQmfe/D8IZdFxvpX3xQKEb/FZF9Jec/nwOmU4IySl 45CLlfpaq7V0z/Kj2OIdVY8/GYx5zyBFIdsyi5ceXGZyuAbPbDiYvSjjMJLsQ2t470tL v0Qw== Received: by 10.60.32.234 with SMTP id m10mr11677967oei.7.1356559943013; Wed, 26 Dec 2012 14:12:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.151.4 with HTTP; Wed, 26 Dec 2012 14:12:02 -0800 (PST) In-Reply-To: References: <8D.41.07178.7380BD05@pb1.pair.com> Date: Thu, 27 Dec 2012 00:12:02 +0200 Message-ID: To: Yussuf Khalil Cc: PHP internals Content-Type: multipart/alternative; boundary=e89a8fb1eff285159304d1c8b956 Subject: Re: [PHP-DEV] RFC: Add a deprecated modifier for functions From: g.b.yahav@gmail.com (Yahav Gindi Bar) --e89a8fb1eff285159304d1c8b956 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Dec 26, 2012 at 5:48 PM, Yussuf Khalil wrote: > Hello, > > assuming that you are referring to the RFC about 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 ) 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 wrote: >> >> Hello, >>> >>> I have created an RFC about adding a deprecated modifier for functions in >>> PHP, see 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 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. --e89a8fb1eff285159304d1c8b956--