Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82871 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 727 invoked from network); 16 Feb 2015 18:41:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2015 18:41:24 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.176 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.176 mail-vc0-f176.google.com Received: from [209.85.220.176] ([209.85.220.176:34497] helo=mail-vc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/99-36518-3D932E45 for ; Mon, 16 Feb 2015 13:41:23 -0500 Received: by mail-vc0-f176.google.com with SMTP id la4so11037967vcb.7 for ; Mon, 16 Feb 2015 10:41:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YR72n36B0aqzFRuPbaPF03gj9MUCLMBUNhFqDz+hdiI=; b=ZcTGdBIaviV/F84c38mTM3Qknm89Qx1uAcXBAgF/mytBAoMYG15PvPFPf703EXWdid 6CzUbjGNB0Ko12at3Ma7F0qu5EnNK6TBxgo0KSgQ5QzCe+NNHth7iaazK9AC1piapdO2 5/B5zKIH7A5e/qFVD8vdlo5luvbdxyYXc8BKmr1fpzKG2YjZ9d+85b1sv34Zt87wtB4F IgDAdCt+K1iJza7awYclR96cZpx11e5Z8jBW1QTj+VQAGJWDk8efFbWqFtB7XaAs032f JXaAtbdY7/Xr0bVv+1g8ngjDvBAji5tddyS5A004LBei57pGmI+cZjt8UcpEkNNjAtYY i0ow== X-Gm-Message-State: ALoCoQlb06Es+aM23+DQmDSkSw+96XHQpHkx1UnD5QUqCqC6u4tx70iUzZnQbEeUojnhue3i2hRBX5w3LAfcg1f3A6UZcFAZPdu0KmSllOZVyyXmEU/CJZ2l4X8GuEsKDiepv1o18NtRedZ7MU9V02Oievh45HABRQ== MIME-Version: 1.0 X-Received: by 10.52.139.7 with SMTP id qu7mr14022992vdb.68.1424112080347; Mon, 16 Feb 2015 10:41:20 -0800 (PST) Received: by 10.52.74.73 with HTTP; Mon, 16 Feb 2015 10:41:20 -0800 (PST) In-Reply-To: <54E228F1.7060307@gmail.com> References: <54E20FC0.3060104@gmail.com> <54E228F1.7060307@gmail.com> Date: Mon, 16 Feb 2015 22:41:20 +0400 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: multipart/alternative; boundary=bcaec52d53abab8319050f38eeb0 Subject: Re: [PHP-DEV] Re: Annotations in PHP7 From: dmitry@zend.com (Dmitry Stogov) --bcaec52d53abab8319050f38eeb0 Content-Type: text/plain; charset=UTF-8 this won't implement features necessary for phpDocumentor, Doctrine, etc. On Mon, Feb 16, 2015 at 8:29 PM, Rowan Collins wrote: > On Mon, Feb 16, 2015 at 6:41 PM, Rowan Collins > wrote: > > Is there any value in deciding the initial syntax for 7.0, and > implementing only non-parameterised annotations, i.e. you can call > hasAnnotation(string): bool but nothing else? > > > Dmitry Stogov wrote on 16/02/2015 16:02: > >> this will work, of course, and robust implementation wouldn't take more >> than a day :) >> but it'll require user-level parser again. no big advantage in comparison >> to doc-block. >> > > No user-level parser would be required (or even possible), because > parameters would be illegal, not just unparsed. > > So, for example, the following would be legal in 7.0: > > <> > function foo() { } > > if ( (new ReflectionFunction('foo'))->hasAnnotation('IsMagic') ) ... > > > But the following would be illegal, even though a similar syntax would be > being prototyped for use in 7.1: > > <> > function foo() { } > > $magic = (new ReflectionFunction('foo'))->getAnnotation('HasMagic'); > > > A few use cases would be possible just with boolean flags, and it would > give us a base to work with going forward. > > It also avoids the situation (as discussed in another thread) of trying to > implement every detail of the implementation of the feature before checking > for consensus. In this case we can check that people are in favour of: > 1) adding annotations as a core feature > 2) the basic syntax (, <>, [Foo], @Foo, etc) > > If there's an overwhelming Yes, that's a confidence boost for whoever > works on the harder parts over the following months. > > > Regards, > -- > Rowan Collins > [IMSoP] > > > --bcaec52d53abab8319050f38eeb0--