Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82866 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87464 invoked from network); 16 Feb 2015 17:29:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2015 17:29:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wg0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:41596] helo=mail-wg0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/B7-36518-8F822E45 for ; Mon, 16 Feb 2015 12:29:28 -0500 Received: by mail-wg0-f49.google.com with SMTP id l18so30704513wgh.8 for ; Mon, 16 Feb 2015 09:29:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=Qx2R2nFGthRRa7p8hmDPvlfZi0aqIt0oN0qTIN2ULpU=; b=D4K5zGBQxasqB+AAYhHcIWtq90AAQwmEIl3ULg7mxkBUMJMxVBV/eK3F6fWRnq2SLN 4v6JdKmeco65TdCT/EvqG4gkmZtdjQbkjYggM7Vlon519enZ1rp8K3B8tMrD+FKkjXpm ZO4o+YzTv0p3M04CMkY/VfB4UjeSBJrUBwOnCEl7wdrTfIV/niqoAG+DZj/mRZ2hiKyE sPtpWgPll3S5l6dIvhJCNE+jauNBhiFE0lWX5rBpEcJosWXUrjOicE1gYQXOOOSBTiEX RZzxEzf2SGYOy9tzAhWKT85sIk90yuMHSZyC7eJbVqzqaHahaCVYPA4zfJeJimrfBVkK m+ow== X-Received: by 10.180.88.165 with SMTP id bh5mr36508530wib.35.1424107765473; Mon, 16 Feb 2015 09:29:25 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id lu13sm20580996wic.10.2015.02.16.09.29.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 09:29:24 -0800 (PST) Message-ID: <54E228F1.7060307@gmail.com> Date: Mon, 16 Feb 2015 17:29:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: PHP Internals References: <54E20FC0.3060104@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------060509060209040903010404" Subject: Re: [PHP-DEV] Re: Annotations in PHP7 From: rowan.collins@gmail.com (Rowan Collins) --------------060509060209040903010404 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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] --------------060509060209040903010404--