Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35623 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38314 invoked by uid 1010); 19 Feb 2008 22:45:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38299 invoked from network); 19 Feb 2008 22:45:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2008 22:45:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lars@strojny.net; 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:35552] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/8B-55225-EFB5BB74 for ; Tue, 19 Feb 2008 17:45:20 -0500 Received: from [192.168.0.8] (xdsl-87-78-210-149.netcologne.de [::ffff:87.78.210.149]) (AUTH: PLAIN lars@schokokeks.org, SSL: TLSv1/SSLv3,256bits,CAMELLIA256-SHA) by milch.schokokeks.org with esmtp; Tue, 19 Feb 2008 23:45:15 +0100 id 0000000000020009.0000000047BB5BFB.00004A30 To: php@stefan-marr.de Cc: internals@lists.php.net, "'Marcus =?ISO-8859-1?Q?B=F6rger=27?=" , "'Johannes =?ISO-8859-1?Q?Schl=FCter=27?=" , 'Sebastian Bergmann' , 'Alexandre Bergel' , 'Falko Menge' , 'Sara Golemon' , derick@php.net In-Reply-To: <001c01c87264$3c01b4e0$b4051ea0$@de> References: <001c01c87264$3c01b4e0$b4051ea0$@de> Date: Tue, 19 Feb 2008 23:45:14 +0100 Message-ID: <1203461114.24580.45.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=_milch.schokokeks.org-18992-1203461116-0001-2" X-Mailer: Evolution 2.21.91 Subject: Re: [PHP-DEV] RFC: Traits for PHP From: lars@strojny.net (Lars Strojny) --=_milch.schokokeks.org-18992-1203461116-0001-2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Am Montag, den 18.02.2008, 20:27 +0100 schrieb php@stefan-marr.de: [...] > To underpin this relationship, it is possible to declare that a Trait > implements an interface like this:: >=20 > interface IHello { > public function sayHello(); > } > =20 > trait SayHello implements IHello { > public function sayHello() { > echo 'Hello World!'; > } > } >=20 > class MyHelloWorld { > use SayHello; > } > =20 > $o =3D new MyHelloWorld(); > var_dump($o instanceof IHello); // bool(true) We have discussed that in IRC a bit and a lot of questions remain. The most important issue to me how to handle interface implementations in cases where methods from the interface implementing trait are renamed in the trait consumer class. I would propose to not overcomplicate things here and I see no real advantage in allowing traits to implement interfaces. I think also for the sake of conceptual integrity separating interfaces clearly from traits is a good idea: interfaces define structure while traits are function buckets. A class may use traits, may implement interfaces and may extend another class. This paradigm is pretty easy to explain to the user. cu, Lars --=20 Lars Strojny Senior Software Developer MediaVentures GmbH (http://mediaventures.de) --=_milch.schokokeks.org-18992-1203461116-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) iQIcBAABAgAGBQJHu1v6AAoJECQPF+sCY6wHjmsP/RzZeWZ3mmzVZq/rloGKcyb8 QfeGNbijPe/ABUDpm/Bj35TjaDwsWH/dVR/pnwQotOZ90BJL+dfoTcZgP+rmrnGQ /hyc6ms1q4mgnhfPcnGZ1bFxj9uJ4HVr1TFKKRopMNDVifR76vKuu5PTR+lJnATm 4JhjMKI8QedNpE6Za8CT89kndtiwS0l5T2SQK1SU1GIi5l9Ji1VL8ks6uQY1ZIZL lUof/IXSRFykaDfdPFGiDBKzjkW+So2EEwHwXe8B955dk8R0xxfrrdPdo3EvpAQ4 zeX9REsYCm2LX2Doq7nzPOYgF1C92BqlFoYFK4igsnzp3wl/IsP3fiRh5usPfGeQ lxJ+L9jj5zsp5a6KCXQ/58F7DFvSKv+xevDSbsoZt15dr28XwjjTlT77vNw3vult RV9A/p1+I7APjR065syvhNE9DHRK5MpTUJaVKz1WDNqJQdAZHLgpmek/UJT3NljM LtxIII8X6czbPG8+Ai+QvJITUG4keOPqcsFkR7LguACpOWDnItdm24ul9S861Uox c+wFIiBMTp3hfO47d8ym2JRRBOkgbSwjn4THnWE/Y3ZUMVd5763zJiIQ8NnWUHRr PBaH7eH4yipPFt+6n5C5HwNxGOgm21FBXmoHtZeNSzlkGtxmms65PIuWUgbOujBF qf1Mxn76o9sPpaqPqI/p =0NAf -----END PGP SIGNATURE----- --=_milch.schokokeks.org-18992-1203461116-0001-2--