Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35758 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53867 invoked by uid 1010); 23 Feb 2008 19:25:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53852 invoked from network); 23 Feb 2008 19:25:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2008 19:25:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@stefan-marr.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@stefan-marr.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain stefan-marr.de from 82.96.83.42 cause and error) X-PHP-List-Original-Sender: php@stefan-marr.de X-Host-Fingerprint: 82.96.83.42 serv6.servweb.de Linux 2.4/2.6 Received: from [82.96.83.42] ([82.96.83.42:46784] helo=serv6.servweb.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/EF-30812-72370C74 for ; Sat, 23 Feb 2008 14:25:27 -0500 Received: from [192.168.0.25] (toolslave.net [85.88.12.247]) by serv6.servweb.de (Postfix) with ESMTP id 1C79B590029; Sat, 23 Feb 2008 20:26:57 +0100 (CET) Message-ID: <47C07329.6080007@stefan-marr.de> Date: Sat, 23 Feb 2008 20:25:29 +0100 Reply-To: php@stefan-marr.de User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Gregory Beaver Cc: Marcus Boerger , Lukas Kahwe Smith , Evert|Rooftop , Stanislav Malyshev , internals@lists.php.net References: <001c01c87264$3c01b4e0$b4051ea0$@de> <173732199.20080219175837@marcus-boerger.de> <1203452909.24580.9.camel@localhost> <1e12984d0802191323o710c6b8ej3a54af7901cf35f1@mail.gmail.com> <47BB4AC9.9070701@zend.com> <1e12984d0802191346x7c145d7fp14c01ec4e5993779@mail.gmail.com> <47BB4F49.1030904@rooftopsolutions.nl> <1e12984d0802191359p4f21c3acrdff4b86adfb4bf3@mail.gmail.com> <1495054633.20080220205951@marcus-boerger.de> <1e12984d0802201243gfa51f01i311891e8965ed51e@mail.gmail.com> <9EE7F229-0710-48E8-9A26-DC8031AF8979@pooteeweet.org> <1985981545.20080222134413@marcus-boerger.de> <47BEE001.9080602@chiaraquartet.net> In-Reply-To: <47BEE001.9080602@chiaraquartet.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Redirected: By TestProxy Subject: Re: [PHP-DEV] RFC: Traits for PHP From: php@stefan-marr.de (Stefan Marr) Hi, > The above presents a problem if trait2 contains conflicting method > names, but a simple way to solve it would be to automatically alias > methods by prepending traitname:: > > > trait trait1 { function a(){}} > trait trait2 { function a(){}} > class Blah extends ... implements ... traits trait1, trait2, trait3 { > } > ?> > > would create method "trait2::a" and we can alias it in the class body. > > Also, $a->{'trait2::a'}(); is legal syntax, so no problems there. > > Example: > > trait trait1 { function a(){}} > trait trait2 { function a(){}} > class Blah extends ... implements ... traits trait1, trait2, trait3 { > function trait2::a as b; > } > ?> > > This would be 100% obvious to me, and far clearer for reading since we > would be explicitly saying we're aliasing a function. Could you please explain where in your proposal is the difference to the multiple inheritance available in C++? Think the auto-aliasing will lead to nothing else then multiple inheritance, with all its power and complexity. One of the main problems here is the fragility, already pointed out be Joshua in its response from today. Kind Regards