On Thu Feb 10 12:25 PM, Ben Schmidt wrote: > > http://wiki.php.net/rfc/traitsmodifications >
Some thoughts: a) Class method conflict with trait Class implementation always wins I feel is the right way to think about traits. But 'abstract' already has special meaning, so maybe a keyword like 'final' could also do something special. b) Support for 'non-breakable traits' - Add trait-local scope Really like the idea and how this could make traits less fragile. e.g. trait Foo { trait $bar; public $bar; } Could change the syntax to: trait Foo { var $bar = 'visibleByTrait'; // variable private to the trait -- zend_mangle_property_name('#Foo {NULL} bar') public $bar = 'visibleByClass'; // variable public to the class it gets composed in } class Test { use Foo; } $t = new Test; echo $t->bar; // 'visibleByClass' Seems like it could allow traits to have their own independent state (private properties), internally ~ zend_mangle_property_name('#' trait name {NULL} prop name). Small note: is there a plan to drop the T_VAR token? Any objections, concerns, more thoughts on the concept? c) Extend 'use' syntax Didn't quite understand, will read again. Have you thought about how this could affect the reflection api and documentation? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php