On Sat Oct 22 10:25 AM, Anthony Ferrara wrote: > Well, I have a few opinions on this that I think are worth sharing: > > 1. If this change is made, we no longer would have mixins, but would > have regular multiple-inheritance (With all the "issues" associated > with it). Note that I said mixins and not traits. That's because > since these were implemented with state (member properties), they are > not traits as implemented, but regular mixins. (Yet another gripe, but > that's slightly off topic). >
I think you misunderstand the difference between traits and mixins: http://code.google.com/p/es-lab/wiki/Traits Scala has mixins, php has traits. In short, the composition order does not matter with a trait (because there are conflict resolution rules). With a mixin, the conflict resolution rule is the order of declaration. class foo mixwith bar1, bar2 {} // bar2 wins Though traits were originally defined as 'stateless', it doesn't make them 'mixins' because they have state: http://bergel.eu/download/papers/Berg07e-StatefulTraits.pdf Javascript is probably the best example of 'mixins': myobject.mixin(bar1,bar2, {otherMethod: function(){} }) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php