Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35675 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99968 invoked by uid 1010); 21 Feb 2008 06:14:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99953 invoked from network); 21 Feb 2008 06:14:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2008 06:14:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=andi@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=andi@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: andi@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:58670] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/11-20678-AB61DB74 for ; Thu, 21 Feb 2008 01:14:20 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 21 Feb 2008 08:14:23 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 20 Feb 2008 22:14:18 -0800 Message-ID: <698DE66518E7CA45812BD18E807866CE014A8DB0@us-ex1.zend.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] RFC: Traits for PHP Thread-Index: Ach0Tlqxa23F0pLnQwmFj44+mVaFlwAAl3ng References: <001c01c87264$3c01b4e0$b4051ea0$@de> <698DE66518E7CA45812BD18E807866CE014A8D9D@us-ex1.zend.net> <200802202354.18400.larry@garfieldtech.com> To: "Larry Garfield" , X-OriginalArrivalTime: 21 Feb 2008 06:14:23.0587 (UTC) FILETIME=[00DF5B30:01C87451] Subject: RE: [PHP-DEV] RFC: Traits for PHP From: andi@zend.com ("Andi Gutmans") Because then you get into similar problems as with multiple inheritance when you have property clashes and other issues. The reason why private is beneficial and different because it will allow you to develop self contained functionality which can be attached to random classes. This can be quite useful for Timers, Counters, Containers, etc... Andi > -----Original Message----- > From: Larry Garfield [mailto:larry@garfieldtech.com] > Sent: Wednesday, February 20, 2008 9:54 PM > To: internals@lists.php.net > Subject: Re: [PHP-DEV] RFC: Traits for PHP >=20 > On Wednesday 20 February 2008, Andi Gutmans wrote: >=20 > > a) > > I think Traits should be able to act as a self-contained behavior > which can > > always be expected to work. For example if I want a Counter behavior > I > > would like that not to depend on the properties in the containing > class. > > While I don't think we should enable public nor protected properties > in > > Traits I think allowing for private properties in Traits would come > in very > > handy. It also is no problem when it comes to mangling as we can use > the > > Trait name. > > > > class Trait { > > private $counter =3D 0; > > function getNextSerialNumber() { > > return $this->counter++; > > } > > } > > > > I strongly recommend not to support protected/public and not to even > get > > into the discussion of dealing with conflicts of such properties. But > I > > think private is very useful. >=20 > Hi Andi. Why no ppp on Traits? It seems useful to be able to pull in > a > utility function or functions that can be leveraged from other methods, > like > domain-specific parsers, without exposing them to the outside world. > Is it > an engine-level implementation issue, or a conceptual complexity issue? > I > don't really see a complexity issue on the developer level, at least > for me. >=20 > -- > Larry Garfield AIM: LOLG42 > larry@garfieldtech.com ICQ: 6817012 >=20 > "If nature has made any one thing less susceptible than all others of > exclusive property, it is the action of the thinking power called an > idea, > which an individual may exclusively possess as long as he keeps it to > himself; but the moment it is divulged, it forces itself into the > possession > of every one, and the receiver cannot dispossess himself of it." -- > Thomas > Jefferson >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php