Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51449 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20627 invoked from network); 15 Feb 2011 14:44:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2011 14:44:24 -0000 Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:63785] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/00-20044-6419A5D4 for ; Tue, 15 Feb 2011 09:44:23 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 24DB35D52 for ; Tue, 15 Feb 2011 09:35:56 -0500 (EST) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VJWPPEA6hvFP for ; Tue, 15 Feb 2011 09:35:55 -0500 (EST) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id ABDD15D51 for ; Tue, 15 Feb 2011 09:35:55 -0500 (EST) Cc: References: <4D206CA4.6060004@yahoo.com.au> <005f01cbadc9$1172d080$34587180$@com> <4D284B8B.5040408@yahoo.com.au> <4D537DE1.2010309@yahoo.com.au> <36AB1B1C-1C92-475D-84C7-D0B0DB8FE462@roshambo.org> <4D541F8A.4050502@yahoo.com.au> In-Reply-To: Date: Tue, 15 Feb 2011 09:35:55 -0500 Message-ID: <007101cbcd1d$a7ac3e60$f704bb20$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcvLaEqrdYciMckTTXyS/lEdJMbc0QBrHqMw Content-Language: en-ca Subject: RE: [PHP-DEV] Extensions to traits From: jbondc@openmv.com ("Jonathan Bond-Caron") On Sun Feb 13 05:15 AM, Andr=C3=A9 R=C3=B8mcke wrote: > > > > I have now made an RFC based on the most recent discussions: > > > > http://wiki.php.net/rfc/traitsmodifications > > >=20 > I think it would sometimes be desirable to allow this, for instance=20 > when a trait has been updated in a framework to adapt to what has=20 > become common practice in classes that uses it in the wild. > ( I assume you already get error if function signature is different=20 > like in inheritance? ) >=20 > So to allow both cases, what about letting people use the final=20 > keyword on functions to signal functions that cannot be re declared=20 > without alias. Or better, add a new keyword since final should mean=20 > final. >=20 I find the implementation in trunk convenient, traits aren't meant to = replace inheritance & ~polymorphism. The 'final' keyword currently means nothing to the class: trait Foo { final static function test() { return 'Test'; } } class A { use Foo; static function test() { return 'Test2'; } } echo A::test(); // returns 'Test2' in trunk That might seem odd but it's not inheritance. There is no error if the class method signature is different from a = trait. I'm comfortable with 'the class always wins', not really sure if should = I be thinking differently... It makes a trait somewhat fragile but that's part of the design vs. = grafts.=20