Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35614 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15730 invoked by uid 1010); 19 Feb 2008 21:08:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15715 invoked from network); 19 Feb 2008 21:08:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2008 21:08:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=truth@proposaltech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=truth@proposaltech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain proposaltech.com from 66.51.199.86 cause and error) X-PHP-List-Original-Sender: truth@proposaltech.com X-Host-Fingerprint: 66.51.199.86 exvs01.ex.dslextreme.net Windows 2000 SP4, XP SP1 Received: from [66.51.199.86] ([66.51.199.86:58076] helo=EXVS01.ex.dslextreme.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/48-55225-0454BB74 for ; Tue, 19 Feb 2008 16:08:17 -0500 Received: from 71.136.9.85 ([71.136.9.85]) by EXVS01.ex.dslextreme.net ([192.168.7.220]) via Exchange Front-End Server owa.dslextreme.net ([192.168.7.126]) with Microsoft Exchange Server HTTP-DAV ; Tue, 19 Feb 2008 21:10:24 +0000 Received: from inspiron by owa.dslextreme.net; 19 Feb 2008 13:08:12 -0800 To: internals@lists.php.net In-Reply-To: References: <001c01c87264$3c01b4e0$b4051ea0$@de> <58510.98.193.37.55.1203374232.squirrel@www.l-i-e.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 19 Feb 2008 13:08:11 -0800 Message-ID: <1203455291.17858.233.camel@inspiron.local> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Subject: Re: [PHP-DEV] RFC: Traits for PHP From: truth@proposaltech.com (Todd Ruth) In case anyone is really excited about traits and traits don't make it in soon, I'll point out that something similar has been available in php for years. We've been implementing traits based on the fact that "$this" has a different meaning in php than in other languages. In php, "$this" is the most recent object context. So... it's easy to create a trait class and make calls to it from your non-trait class using "::" syntax. "->" calls within the trait class automatically go back to the non-trait class. This makes the purists shudder and they added a STRICT message for it. (If you're a purist please don't bother replying with how evil I am. I already know this makes your stomach turn.) It obviously isn't as clean as a well defined trait feature (or doing a re-architecture of your app to elimate the need), but if you need traits today, this may work for you. - Todd