Consider a class that prints an outline table for a particular product line.  Say you have several, A, B, C, D.  The mechanism of the table generation is the same, but the data is different.  I could create a base class called OutlineTableGenerator, and one class per product line each that extend that base class.  I can put data getters into individual product classes and let the base class operate on the data.  Observe below:class OutlineTableGenerator{    protected $vars;    function __construct($vars)    {        $this->vars = $vars;            }    public function getOutlineTable()    {        $data = $this->getOutlineTableData();  //my question is about this line    }}and  class OutlineTableGeneratorForProductA extends OutlineTableGenerator{    function __construct($vars)    {        parent::__construct($vars);     }    protected function getOutlineTableData()    {         return ['data' => $this->vars['stuff']];    }}See line $data = $this->getOutlineTableData();.  My problem with this line is that my IDE, nor any other IDE for that matter, will be able to figure out which class & function it will resolve to at run time.  I quite frequently use a feature to jump from the line in the code where a function is called, to the actual function declaration.  In this case, I using that feature on the line in question will not jump to function declaration.  Because there are several of those, and nor IDE nor programming language itself knows which function I want.  I think this is bad.Is there a work-around?  Is this a drawback of polymorphism in OO?  How do YOU live with it?
Is not being able to resolve a function call to its declaration a drawback of Polymorphism?
object oriented;php;polymorphism
A failure in polymorphism? I guess that depends on how you use the classes.Do you ever instantiate an OutlineTableGenerator object? Because I would expect any such object to cause a fatal error if its getOutlineTable method is ever called.It looks like you really have an abstract class there; one which is never instantiated directly, but can be extended and also used for type hinting within parameter lists.abstract class OutlineTableGenerator {   ...    public function getOutlineTable() {        $data = $this->getOutlineTableData(); //my question is about this line   }    abstract function getOutlineTableData();}My IDE will usually then offer me a list of implementations whenever I follow the reference for such an abstract function call.