Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35651 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25723 invoked by uid 1010); 20 Feb 2008 11:37:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 25707 invoked from network); 20 Feb 2008 11:37:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2008 11:37:00 -0000 Authentication-Results: pb1.pair.com header.from=lars@strojny.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain strojny.net designates 85.10.204.248 as permitted sender) X-PHP-List-Original-Sender: lars@strojny.net X-Host-Fingerprint: 85.10.204.248 milch.schokokeks.org Received: from [85.10.204.248] ([85.10.204.248:56549] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/E3-30965-BD01CB74 for ; Wed, 20 Feb 2008 06:37:00 -0500 Received: from [10.22.2.133] (colt-d53d2146.colt.mediaventures.de [::ffff:213.61.33.70]) (AUTH: PLAIN lars@schokokeks.org, SSL: TLSv1/SSLv3,256bits,CAMELLIA256-SHA) by milch.schokokeks.org with esmtp; Wed, 20 Feb 2008 12:36:56 +0100 id 0000000000020003.0000000047BC10D8.000045DD To: Markus Fischer Cc: php@stefan-marr.de, internals@lists.php.net, 'Sebastian Bergmann' , 'Alexandre Bergel' , 'Falko Menge' , 'Sara Golemon' , derick@php.net In-Reply-To: <47BC0B63.80803@fischer.name> References: <001c01c87264$3c01b4e0$b4051ea0$@de> <47BC0B63.80803@fischer.name> Date: Wed, 20 Feb 2008 12:36:56 +0100 Message-ID: <1203507416.12675.33.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=_milch.schokokeks.org-17885-1203507416-0001-2" X-Mailer: Evolution 2.21.91 Subject: Re: [PHP-DEV] RFC: Traits for PHP / Reflection From: lars@strojny.net (Lars Strojny) --=_milch.schokokeks.org-17885-1203507416-0001-2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Markus, Am Mittwoch, den 20.02.2008, 12:13 +0100 schrieb Markus Fischer: [...] > generally asking, how would Reflection act on traits? Can this be=20 > detected or will the information be lost after a class has been=20 > assembled? E.g. detect if a certain method comes from a trait and which o= ne? Good question. The current patch does not include anything about reflections. But as the information about traits is present in the struct zend_class_entry is is possible to expose trait information via the reflection API. I would propose something like this: class ReflectionTrait: * getMethods(): array[ReflectionMethod] * ... pretty similiar to ReflectionClass extending class ReflectionClass: * getTraits(): array[ReflectionTrait] * usesTraits(): bool extending class ReflectionMethod: * flattened(): bool * getTrait(): ReflectionTrait Maybe ReflectionMethod::flattened() should be ReflectionMethod::belongsToTrait() or something like this, I'm not sure here. cu, Lars --=_milch.schokokeks.org-17885-1203507416-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: Dies ist ein digital signierter Nachrichtenteil -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iQIcBAABAgAGBQJHvBDYAAoJECQPF+sCY6wHjPoP/ikdqtLQ3kgqB0RK1hhjyTNP Lr06imjg3pWbv8lkOCSMdmaSFMWgwVhAYLbVbJMvLxReGj5t1zboy2205bJdSuco 9A/0iih+GdOBRPskOuF6ycJVLlAegNY5SAA0dh39Ikl02zowahU2zVH7wR2wdkNq XBx/BhvsWLjYOcqXjJitZkin0zbwmBMzYsEGawfAKJ6se0+geWVPuKkEDi8+dDUd rADBszncBHXNCs8caqNDLdZie4mTAHK78bHuGDQp4BNV4tF5onkJoAcKE8Nv01fa Q5aV0UbIA1JmfSMwCr7PZlpLV6aAf0hLRmp/Bx6/0oDnAI1n1elpF5XujeOA1zhs iKWoMGrlg0gqc9OgwhoMUIIuDYlanyTolZIHPtKPQzA72oXxrRe7R+mJjCbE8sfT FIPzMaIxHJjXUGTxk7yud3ZzZW1BAgqYjtLqHuqv+BRFm5GJlXqBeAXDn8NwI0Me ZEq6w311CHcsyYRr7pcrEkuECQCl/RytvmXrLPKyC6gHoRnvu0ONescEIyrJFYcf WhQotiyp4QZEZKrxpgSfIM4EdB0JA5xKE8ut9ZQrdibQ7fpB+BG3SiAgyBAJsMW5 E8kJcUjAFbEJ+DSfFod7YNSZKjmLb1tdXiZ5ZElIiEBpUcEusEyk55SUJ0PttXdT ZiHWHfvF+VB2NDa6pYwK =ORVY -----END PGP SIGNATURE----- --=_milch.schokokeks.org-17885-1203507416-0001-2--