php - Is using double class inherit can be dangerous? -


i using kind of model:

  • class extends class b
  • class c extends class

example short piece of code:

class interfacecontroller extends abstractactioncontroller {     public function getrole() {         $userlogin = $this->getauthservice()->getidentity();         if ($userlogin != null && $userlogin != "")         {             $userdata = $this->getuserslogintable()->getuserbylogin($userlogin);             if ($userdata)              {                 $role = $userdata->user_permissions;             }             else             {                 $role = null;             }         }         return $this->role;     }     }  class postscontroller extends interfacecontroller {     public function postsmainviewaction() {        $layout = $this->layout();        $layout->settemplate('mainsite/layout');        $view = new viewmodel();        $view->settemplate('posts/posts/index');        return array(            'role' => $this->getrole()        );     } } 

example based on zend framework 2 application question still more general oop model

question follows: "can use of extend classes negative influence application performance ?"

the weakest spot in example give don't show methods (at time answered question). without methods given, can superfluous.

if wouldn't regard superfluous problem, there no problem.

as there ain't no logic involved well, logic can not flawed inheritance describe.

hope helps. in other cases, e.g. if classes have methods, for:

  • composition on inheritance
  • liskov substitution principle