Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52192 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58707 invoked from network); 10 May 2011 01:23:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 May 2011 01:23:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.163 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.163 smtp163.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.163] ([207.97.245.163:50870] helo=smtp163.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/17-14908-F7398CD4 for ; Mon, 09 May 2011 21:23:13 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp46.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id A170FE8279; Mon, 9 May 2011 21:23:09 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp46.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 094B7E8203; Mon, 9 May 2011 21:23:08 -0400 (EDT) Message-ID: <4DC8937C.6080609@sugarcrm.com> Date: Mon, 09 May 2011 18:23:08 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: "guilhermeblanco@gmail.com" CC: Lester Caine , PHP internals References: <4DC826B1.4090806@lerdorf.com> <4DC82A36.8090604@lerdorf.com> <4DC85FBE.2060005@lsces.co.uk> <4DC8885C.9090608@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Please let's not bitch about lazy users not learning C to implement THEIR missing feature. (Was Re: [PHP-DEV] 5.4 again) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Objects are only instantiated when requested (getAnnotations() or > getAnnotation()) So how this happens - does the class store the text of the annotation? Or expressions in the call are evaluated and stored, but the object is not instantiated? What if I call getAnnotation() repeatedly - are they re-instantiated or stored somewhere, and if so - where? >> 2. What is permissible in the arguments of annotation - e.g. can I put any >> expression there? > > You are allowed to use any scalar value + array + any object that > implements ReflectionAnnotation interface. By scalar value you mean constant value? Are constants allowed? >> 3. What)> actually means and how it is supposed to be parsed? > > It would instantiate a class Bar and would pass it as an instance of > Foo that is also being created when doing getAnnotations() or > getAnnotation('Foo') So when exactly Bar is instantiated - when getAnnotations() is called? >> 6. Do we need any special support for bytecode caches? > > Yes. Every structure which can be annotated now will have a new member > in their C structure which is annotations, this structure is populated > at compile time and store all the metadata information. So if you have > an opcode cache the compilation will not occur, so the annotations > will be NULL. That's why the opcode cache will have to store the > annotations, so that it can be retrieved every time. This then should be added to the proposal. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227