Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5342 invoked from network); 23 Jul 2011 13:58:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2011 13:58:39 -0000 Authentication-Results: pb1.pair.com header.from=stefan.marr.de@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stefan.marr.de@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) X-PHP-List-Original-Sender: stefan.marr.de@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:55156] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/01-32631-F83DA2E4 for ; Sat, 23 Jul 2011 09:58:39 -0400 Received: by qwi4 with SMTP id 4so1717859qwi.29 for ; Sat, 23 Jul 2011 06:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=IWEgEUlGfImhk+RTgkpiU0Q2TtlbZzHq6mXPyDYDg2s=; b=h7aVsoae/1JcR9kKrkCGlYAvxeVftWdY1/1I0P46iJ2V4s/oMch9D9cDcjr1+2LQXN E+L3O+SJRWwjGzpH+NBZaGd7shiYbj+pn9ug3FnmpzWXXipUph9bKZNmxk15074Vtc0E BGbyvtWccDRVdNHCjpqqrQdDcpoVapoa13pDI= MIME-Version: 1.0 Received: by 10.229.87.211 with SMTP id x19mr2039784qcl.9.1311429516671; Sat, 23 Jul 2011 06:58:36 -0700 (PDT) Reply-To: php@stefan-marr.de Sender: stefan.marr.de@gmail.com Received: by 10.229.89.129 with HTTP; Sat, 23 Jul 2011 06:58:36 -0700 (PDT) In-Reply-To: <007901cc489f$01d02580$05707080$@com> References: <4E29949C.9020209@gmail.com> <004701cc4890$f9d63f80$ed82be80$@com> <4E29B780.1030009@gmail.com> <007901cc489f$01d02580$05707080$@com> Date: Sat, 23 Jul 2011 15:58:36 +0200 X-Google-Sender-Auth: s0xjUnATnKel1gpQ8_WoaB8Fbfs Message-ID: To: Jonathan Bond-Caron Cc: Alex Howansky , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] 5.4a2 trait attribute name conflict resolution From: php@stefan-marr.de (Stefan Marr) On Fri, Jul 22, 2011 at 8:41 PM, Jonathan Bond-Caron wrote: > On Fri Jul 22 01:46 PM, Alex Howansky wrote: >> >> Sure, but in this case, I created the conflict intentionally because I >> *want* to override it, and I'm not allowed to like I am with methods. >> Don't you think that's inconsistent? >> > > Agree I do not agree, because for methods there is for most cases a way around. You can introduce a new alias for the same behavior and use that from the method which is overriding the original method name of the trait. Thus, there is a flexible way to compose behavior, and that is what we do everyday. State how ever, does not come with that property, and the last time we discussed different ideas in that direction they were deemed to be complex. > So that traits can keep their own private state (Ben Schmidt's idea) One of those ideas should definitely be reconsidered for a later version of PHP, but for the moment, I would prefer to concentrate on getting bug-free what we have already and gather some experience on how it is actually used in real-world scenarios. In the end, if you trait is to complex and can 'break' easily, I think that shows that it is worth to be implemented as a class, and you might use instead a trait that provides you with the necessary delegation functions. Best regards Stefan