Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54193 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95429 invoked from network); 25 Jul 2011 21:05:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2011 21:05:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=stefan.marr.de@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stefan.marr.de@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.177 as permitted sender) X-PHP-List-Original-Sender: stefan.marr.de@gmail.com X-Host-Fingerprint: 209.85.216.177 mail-qy0-f177.google.com Received: from [209.85.216.177] ([209.85.216.177:35262] helo=mail-qy0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/00-29470-A9ADD2E4 for ; Mon, 25 Jul 2011 17:05:31 -0400 Received: by qyk7 with SMTP id 7so3307304qyk.8 for ; Mon, 25 Jul 2011 14:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=djUMXusDpbOFfHswYYs5/a05ebkGannMpHArxgPw6Eo=; b=rlZZf1fjuNCPbGF+4pTw7wU31FjpQ5FAbXRgFsNnl759fnQkcccCwyLJre5xIxKOox 34zTVYxeRT5fvBr7yPPGq/ND1ZK9vfBU2Jn/LfryuenY1+c8k6Fl+NmtdsQmJVtXIE9d fCuyRu5+rMhNS0a/tWgXWAPtR4Ary3/F4zK9g= MIME-Version: 1.0 Received: by 10.229.198.233 with SMTP id ep41mr3712846qcb.199.1311627927226; Mon, 25 Jul 2011 14:05:27 -0700 (PDT) Reply-To: php@stefan-marr.de Sender: stefan.marr.de@gmail.com Received: by 10.229.89.129 with HTTP; Mon, 25 Jul 2011 14:05:27 -0700 (PDT) In-Reply-To: <1311614509.2886.16.camel@guybrush> References: <1311614509.2886.16.camel@guybrush> Date: Mon, 25 Jul 2011 23:05:27 +0200 X-Google-Sender-Auth: BOsBfvZh4HXmeFahQ4nWswOB3E4 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: PHP internals list , gron@php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Reflection, Traits, Aliasing From: php@stefan-marr.de (Stefan Marr) Hi Johannes: 2011/7/25 Johannes Schl=FCter : > Now I use reflection on this: > > $rc =3D new ReflectionClass('C'); > print_r($rc->getTraitAliases()); > > Array > ( > =A0 =A0[tc] =3D> T1::t1 > ) Great, that is nice. > So far so nice but I'm missing the information where C::t1() is coming > from. In the reflection code I'm currently iterating over > ce->trait_aliases and can't find where I can get the information from. > Actually I'd be even interested in getting all important methods and > their origin. Stefan, do you know where I can find the information or > would we have to store it additionally? The functions do not store that information, so there are basically only two approaches, I see: Either, factoring out the code which is doing the flattening, conflict resolution, and class composition into something which could be easily shared by both the reflection and the engine, and then re-doing it on demand in the reflection, or we extend zend_function by an origin pointer. Not sure what the better tradeoff is general memory overhead vs. cache-able pay-as-you-go overhead. Best regards Stefan