Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64785 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99534 invoked from network); 9 Jan 2013 20:24:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 20:24:46 -0000 Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 67.200.53.250 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 67.200.53.250 mail.zerocue.com Received: from [67.200.53.250] ([67.200.53.250:57582] helo=mail.zerocue.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/C8-02684-C02DDE05 for ; Wed, 09 Jan 2013 15:24:44 -0500 Received: from [172.17.0.122] (unknown [66.25.151.173]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.zerocue.com (Postfix) with ESMTPSA id AFF25120807; Wed, 9 Jan 2013 20:24:41 +0000 (UTC) Message-ID: <50EDD202.806@zerocue.com> Date: Wed, 09 Jan 2013 14:24:34 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: "guilhermeblanco@gmail.com" CC: "internals@lists.php.net" References: <50EBDEEE.8070605@sugarcrm.com> <50EDA1C5.4040500@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Reflection annotations reader From: cpriest@zerocue.com (Clint Priest) This version of annotations (attributes?) is much more interesting than the most recent version, but I could see this syntax as being a problem if it were allowed to apply to plain functions because then the parser would have difficulty distinguishing from an array. I suppose the same could be said of applying it to a class. In essence though, this prior revision is exactly the kind of thing that I would be interested in if we could get past the parsing issues... On 1/9/2013 1:57 PM, guilhermeblanco@gmail.com wrote: > Pierrick, before update v3 of patch, let's first clarify things that need > to be discussed. > Rasmus, you have no idea how happy you made me for a gentle comment > pointing something we should think before propose a patch instead of on > (sorry for the wording) bitching about the idea. > > There're tons of elements that need to be addressed before working on a > patch. > The latest annotations RFC is a small subset of what other languages > support. To a more complete feature-wise, it is required to go to a > previous revision: https://wiki.php.net/rfc/annotations?rev=1302087566 > > Some of the elements that needs to be considered: > > - Should we support nested annotations? > > - How [Foo()] will be different from new Foo()? If they are not different, > is there an alternative to not bloat lexical parsing? > > - How parameters would be injected? Is constructor the only way to inject > parameters? > > - How would we handle optional parameters, like [Foo("bar", null, null, > "woo")]? > > - Suppose you wanna fix the optional arguments by named parameters, like > [Foo("bar", test="woo")]. Doesn't it diverge with PHP interests of not > supporting parametrized arguments? Should we modify the former or the > later? Personally I'm a fan of named parameters. > > - How would we deal with inheritance? Should a method, for example, inherit > the same annotations from parent or not? > > - Suppose that you define annotations to fix the inheritance problem, how > would it be? > > - How would we cast possible usages of an annotation to only class, method > or property? Using annotations too? > > - How would it be the syntax to declare a new annotation? > > - Would it be possible to modify an annotation value using Reflection, for > example? > > - How could it be handled on APC to minimize the performance impact? > > > Let's discuss? Thanks. > > > > On Wed, Jan 9, 2013 at 2:24 PM, Marco Pivetta wrote: > >> @Stas we've already come to that, and this is a way to store metadata: the >> discussion here is just if and how it should get to PHP :) >> >> Marco Pivetta >> >> http://twitter.com/Ocramius >> >> http://ocramius.github.com/ >> > > -- -Clint