note 107724 added to language.oop5.traits

From: Date: Wed, 29 Feb 2012 08:55:01 +0000
Subject: note 107724 added to language.oop5.traits
Groups: php.notes 
Request: Send a blank email to php-notes+get-186425@lists.php.net to get a copy of this message
Can anyone please enlighten me on the difference between traits and multiple inheritance? Why can't we just do this: <?php class ezcReflectionReturnInfo { function getReturnType() { /*1*/ } function getReturnDescription() { /*2*/ } } class ezcReflectionMethod extends ReflectionMethod, ezcReflectionReturnInfo { /* ... */ } class ezcReflectionFunction extends ReflectionFunction, ezcReflectionReturnInfo { /* ... */ } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 120.89.47.11 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.traits.php Edit -- https://master.php.net/note/edit/107724 Del: integrated -- https://master.php.net/note/delete/107724/integrated Del: useless -- https://master.php.net/note/delete/107724/useless Del: bad code -- https://master.php.net/note/delete/107724/bad+code Del: spam -- https://master.php.net/note/delete/107724/spam Del: non-english -- https://master.php.net/note/delete/107724/non-english Del: in docs -- https://master.php.net/note/delete/107724/in+docs Del: other reasons-- https://master.php.net/note/delete/107724 Reject -- https://master.php.net/note/reject/107724 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186425) next »