note 107735 added to language.oop5.traits
| From: | Edward | Date: | Thu, 01 Mar 2012 03:29:07 +0000 |
| Subject: | note 107735 added to language.oop5.traits | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186436@lists.php.net to get a copy of this message | ||
The difference between Traits and multiple inheritance is in the inheritance part. A trait is not
inherited from, but rather included or mixed-in, thus becoming part of "this class".
Traits also provide a more controlled means of resolving conflicts that inevitably arise when using
multiple inheritance in the few languages that support them (C++). Most modern languages are going
the approach of a "traits" or "mixin" style system as opposed to
multiple-inheritance, largely due to the ability to control ambiguities if a method is declared in
multiple "mixed-in" classes.
Also, one can not "inherit" static member functions in multiple-inheritance.
----
Server IP: 69.147.83.197
Probable Submitter: 75.46.79.70
----
Manual Page -- http://www.php.net/manual/en/language.oop5.traits.php
Edit -- https://master.php.net/note/edit/107735
Del: integrated -- https://master.php.net/note/delete/107735/integrated
Del: useless -- https://master.php.net/note/delete/107735/useless
Del: bad code -- https://master.php.net/note/delete/107735/bad+code
Del: spam -- https://master.php.net/note/delete/107735/spam
Del: non-english -- https://master.php.net/note/delete/107735/non-english
Del: in docs -- https://master.php.net/note/delete/107735/in+docs
Del: other reasons-- https://master.php.net/note/delete/107735
Reject -- https://master.php.net/note/reject/107735
Search -- https://master.php.net/manage/user-notes.php