Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89441 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15937 invoked from network); 26 Nov 2015 10:07:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2015 10:07:26 -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.54 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wm0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:33420] helo=mail-wm0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/C4-05516-ED9D6565 for ; Thu, 26 Nov 2015 05:07:26 -0500 Received: by wmec201 with SMTP id c201so23540301wme.0 for ; Thu, 26 Nov 2015 02:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=c5dcNtx480a2+CyuJBMDZ0mDyL/IC8lsoRye1gq9Ppg=; b=SBgqf63FfYsbTndKi8X/gKP73Oqi7nT5rmQk2RhygyQTzqRtilLpTmxbn9cO8pL7D7 YEs5ulKrIb/fUGdAZR6S8EziV2f+AA3CbKmyh+UQLfqX0Bp8lVVRNZ0v6B1LRuIXDTEt MhSyQIScAB2bNHWHYOO1NrIoTpbZVoouxkbGPRVpz9vcv4XlugziZeY0vX52g8VOqeL2 suoJuyrHgj3fFfx1ch1e+0VF+g7wyYLiMkRgq3LkZgviMpeBLStPPqhrr4tKlb5iADga bHAVQAmAUWLBJv6lndp4K8x0XDAdV4+TIYtSyjv2Yjt53hILCzmiaarabvGYLiDINXyL ctbg== X-Received: by 10.194.188.112 with SMTP id fz16mr54760034wjc.65.1448532442742; Thu, 26 Nov 2015 02:07:22 -0800 (PST) Received: from [192.168.0.147] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id 67sm1949428wmm.6.2015.11.26.02.07.21 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Nov 2015 02:07:22 -0800 (PST) To: PHP internals References: <5654B516.4020700@gmail.com> <5655D82A.8020304@lsces.co.uk> <5655E4E4.8070200@garfieldtech.com> <5655E61E.3000904@gmail.com> <5655E93F.90506@gmail.com> <5655F24B.6020401@garfieldtech.com> <5655F47C.3060504@gmail.com> <1B1E6CD7-2378-43CA-A636-83383707AF8E@gmail.com> Message-ID: <5656D99F.10707@gmail.com> Date: Thu, 26 Nov 2015 10:06:23 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Native Annotation Syntax From: rowan.collins@gmail.com (Rowan Collins) guilhermeblanco@gmail.com wrote on 26/11/2015 01:13: > Ok, so I'll explain why it's not "the same way" as you imagine. > > I've heard this many times already so I'll save you keystrokes. > - "Sure, we can do that on docblocks" > - "Based on that, it doesn't need to be part of core and can safely be > implemented as a PECL extension" > OK, as far as everything I was talking about, this is all rather a straw man, but perhaps that's just a miscommunication on my part, so let me clear that up: I have never suggested, and would not support a suggestion, that this be implemented as an extension. I can absolutely see the advantage to having a first-class syntax, baked into the main parser. With that out of the way, we are back to the main point I was trying to make which is that that syntax could, if we wanted, live inside the context of /** */ blocks, which are already treated differently from comments. The parsing problems within that context are very similar to the parsing problems in any other context (again, assuming that this is being implemented directly in the core parser, not in any kind of extension). So, the pros and cons of that are not to do with the parsing but to do with: - potential compatibility with existing code, which may be tricky as there is no standard to base the feature on - the ability to polyfill code in older PHP versions, which is useful but not something we have aimed for with previous features - on the other side, the perception that docblocks are "just comments", which would be hard to dispel even if we renamed them "metadata blocks" Anyway, I apologise for drawing out this part of the discussion for so long. I actually think it's just one of many decisions that needs making before this feature can be attempted, probably starting with just what an annotation consists of - is it a label with some text attached? a resolved class name with parsed PHP code passed to its constructor (some people have mentioned arrays and heredocs as parameters to annotations)? somewhere between the two? Regards, -- Rowan Collins [IMSoP]