Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64783 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94276 invoked from network); 9 Jan 2013 19:58:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 19:58:10 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:43132] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/08-02684-0DBCDE05 for ; Wed, 09 Jan 2013 14:58:10 -0500 Received: by mail-ob0-f170.google.com with SMTP id wp18so2650501obc.29 for ; Wed, 09 Jan 2013 11:58:06 -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=Buc9txBT1sp3bkovSoWUltvuUUp9ndZpHho90CH0ZkY=; b=cW9DLpcDh6VzbTvjFaTn12mnnWO0Smhfd8DJ5Oej5iy4fLmY7gzygDMkPB4xQD83ea SKlQOxjUILIGQfshK8bPFVXDaVkIU8SiSAKNqLz2Ljiq7TWC6od4sK0lreHT0nbJCKxL mF67WgiRmwuSRWO7og4xZ1CN3mbQj0Lbk0SljkM7N17Yj8xCMG+uoNjP4ckKsDDKjvTl 8avUWTvyrdBxf2jUji5R+iEGz0LABpjj4oWcJdG8qbG+JnBHb5+Vgfw0+aBQ/eg8MhkA SoytGU/aeBQH7Dp8li52BS8h2o13qLidhVT3OO0QaQdV/cJZxhaT3HKcJnfkp19PNg4H 0LFA== Received: by 10.60.1.42 with SMTP id 10mr38866013oej.125.1357761486484; Wed, 09 Jan 2013 11:58:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.174.68 with HTTP; Wed, 9 Jan 2013 11:57:46 -0800 (PST) In-Reply-To: References: <50EBDEEE.8070605@sugarcrm.com> <50EDA1C5.4040500@sugarcrm.com> Date: Wed, 9 Jan 2013 14:57:46 -0500 Message-ID: To: Marco Pivetta Cc: Stas Malyshev , Derick Rethans , Pierrick Charron , Rasmus Schultz , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=e89a8fb1fe1817763a04d2e07bd7 Subject: Re: [PHP-DEV] [RFC] Reflection annotations reader From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --e89a8fb1fe1817763a04d2e07bd7 Content-Type: text/plain; charset=UTF-8 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/ > -- Guilherme Blanco MSN: guilhermeblanco@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada --e89a8fb1fe1817763a04d2e07bd7--