Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35653 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15109 invoked by uid 1010); 20 Feb 2008 19:59:55 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15093 invoked from network); 20 Feb 2008 19:59:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2008 19:59:55 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:38731] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/22-30965-9B68CB74 for ; Wed, 20 Feb 2008 14:59:55 -0500 Received: from dhcp-172-28-202-237.zrh.corp.google.com (unknown [193.142.125.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 185921B365D; Wed, 20 Feb 2008 20:59:50 +0100 (CET) Date: Wed, 20 Feb 2008 20:59:51 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1495054633.20080220205951@marcus-boerger.de> To: "Stefan Marr" CC: Evert|Rooftop , "Stanislav Malyshev" , In-Reply-To: <1e12984d0802191359p4f21c3acrdff4b86adfb4bf3@mail.gmail.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Traits for PHP From: helly@php.net (Marcus Boerger) Hello Stefan, so at th eend of the day users will get renaming and will abuse it. That said I am wondering if at the beginning we might want to do Traits without aliasing and dropping. If we feel it gets necessary we probbaly might want to support a syntax like: 'trait_method' => false 'trait_method' => 'new_name' 'trait_method' => array('new_name', 'trait_method' I am suggesting this because it is more what people expect to find. And it is easier to understand imo. marcus Tuesday, February 19, 2008, 10:59:20 PM, you wrote: > Hi Evert, >> Aliasing doesn't make a lot of sense, as you can always : >> >> function newMethod() { >> return $this->oldMethod(); >> } > Don't think so. > You do use aliasing to handle conflicts and in the case of a conflict > there is no oldMethod. > trait A { > public function foo() {echo 'foo';} > } > trait B { > public function foo() {echo 'fooBar';} > } > class MyClass { > use A; > use B { > !foo, fooBar => foo > } > } > The result will be at runtime: > class MyClass { > public function foo() {echo 'foo';} > public function foo() {echo 'fooBar';} > } > Here you can't do something like this: > class MyClass { > use A; > use B; > } > since eventually there wont be any method in MyClass. Best regards, Marcus