Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54159 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28664 invoked from network); 23 Jul 2011 16:49:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2011 16:49:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=mikegstowe@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mikegstowe@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) X-PHP-List-Original-Sender: mikegstowe@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-gw0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:44167] helo=mail-gw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/24-32631-CABFA2E4 for ; Sat, 23 Jul 2011 12:49:48 -0400 Received: by gwb17 with SMTP id 17so2336116gwb.29 for ; Sat, 23 Jul 2011 09:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=ndW8jGC/kqLXrFuwHH0uxoM9709QYngmL8WkMkqjGWA=; b=wrfmSwX3YkHliApI9/urO8Fctd45I5Odafl5qUh84sm8LAZRj1UjAXLBXRQg5utUsl xLm7uN+lXqtWPnO/WV8qGBWhzZA3B1YWsq4dCleznVFcqAOAhco9aoHTL+fiQgAyB1bc dIPH6P8jykII5VcfFL0IFgCFK82aWehxCeViw= Received: by 10.101.179.12 with SMTP id g12mr2578223anp.59.1311439785745; Sat, 23 Jul 2011 09:49:45 -0700 (PDT) Received: from [10.33.101.112] (mobile-198-228-226-019.mycingular.net [198.228.226.19]) by mx.google.com with ESMTPS id z5sm3425471anb.20.2011.07.23.09.49.41 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Jul 2011 09:49:44 -0700 (PDT) References: <4E29949C.9020209@gmail.com> <004701cc4890$f9d63f80$ed82be80$@com> <4E29B780.1030009@gmail.com> <007901cc489f$01d02580$05707080$@com> In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8C148) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-ID: Cc: Jonathan Bond-Caron , Alex Howansky , "internals@lists.php.net" X-Mailer: iPhone Mail (8C148) Date: Sat, 23 Jul 2011 11:49:32 -0500 To: "php@stefan-marr.de" Subject: Re: [PHP-DEV] 5.4a2 trait attribute name conflict resolution From: mikegstowe@gmail.com (Mike Stowe) So am I understanding correctly that the initial properties must be identica= l both in type and value, otherwise it would throw an error. To me that woul= d make the most sense as they could be overridden in a construct or other me= thod.=20 If they are allowed to be different with one overriding the other- than for u= sability the class should override the trait properties as it does with meth= ods. This way it remains consistent, which I think would be the general exp= ectation. The trait should likewise override the parent class properties as= it does with the parent methods (unless I misread that). But essentially if= they're allowed to be different the overriding pattern IMHO should be the s= ame as that used for methods.=20 - Mike :o) Sent from my iPhone On Jul 23, 2011, at 8:58 AM, Stefan Marr wrote: > On Fri, Jul 22, 2011 at 8:41 PM, Jonathan Bond-Caron w= rote: >> On Fri Jul 22 01:46 PM, Alex Howansky wrote: >>>=20 >>> 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? >>>=20 >>=20 >> Agree >=20 > 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. >=20 >> So that traits can keep their own private state (Ben Schmidt's idea) >=20 > 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. >=20 > Best regards > Stefan >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20