On 2010-12-19, Stefan Marr <p...@stefan-marr.de> wrote: > On 19 Dec 2010, at 17:22, Matthew Weier O'Phinney wrote: > > Exactly. I wouldn't default to public on conflicts, though -- just with > > the highest declared visibility (e.g., if one trait defines as private > > and the other as protected, protected wins). > I am currently actually implementing the most restricted proposal: all > differences in the property definition will lead to a fatal error. > > The reasoning behind this is, that the semantics of state is not > predictable and all changes in the class/traits hierarchies which are > incompatible should give the developer an immediate feedback, i.e., > make potentially incompatible code break. That is not the most > 'dynamic' of all possible solutions but seems to fit with the rest of > PHP.
That makes sense to me as well; having conflicting properties due to multiple traits implementing them is a good way to lead to inconsistency and difficult to test/predict code. > What I have in mind is also not how the methods integrate into the > inheritance chain, thus, a property in the body of the class does not > override all property definitions in traits (this is the case for > methods). I think that will be useful for the very same reason. And > well, I hope an educative error message will steer the crowed in the > right direction to use accessors. -- Matthew Weier O'Phinney Project Lead | matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php