Re: RFC: Traits for PHP

From: Date: Mon, 18 Feb 2008 23:08:26 +0000
Subject: Re: RFC: Traits for PHP
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-35567@lists.php.net to get a copy of this message
On Feb 18, 2008 5:37 PM, Richard Lynch <ceo@l-i-e.com> wrote: > On Mon, February 18, 2008 1:27 pm, php@stefan-marr.de wrote: > > <?php > > trait ezcReflectionReturnInfo { > > function getReturnType() { /*1*/ } > > function getReturnDescription() { /*2*/ } > > } > > > > class ezcReflectionMethod extends ReflectionMethod { > > use ezcReflectionReturnInfo; > > So it's just like an include for a re-used body of 'class' code. > > Hmmmm. > > Why not just allow 'include' here instead? Oh come on.. > > :-) > > Forgive me if I'm missing something subtle/complex here, but I wonder > if a Trait is really the "right answer"... > > Yes, the ability to add/exclude specific functions from two Traits is > "gone" with a simple 'include'... But so is the complexity of yet > another language construct... Please if you do not understand a concept, do not bash it or degrade it. Read the proposal, read about traits, read the thesis, read the patch, then if you still don't understand, give up, and if you do understand, you can complain. Thanks, > > -- > Some people have a "gift" link here. > Know what I want? > I want you to buy a CD from some indie artist. > http://cdbaby.com/from/lynch > Yeah, I get a buck. So? > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- David Coallier, Founder & Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18

« previous php.internals (#35567) next »