title: Superclass and Subclasses in PHP
body: <p>Consider the following PHP class code</p>
  
  <pre><code>class SuperIdea{
  .
  .
  .
  static function getById($id){  new SuperIdea(.......); } 
  .
  .
  .
  .
  }
  
  class SubIdea extends SuperIdea{
  }
  </code></pre>
  
  <p>The problem I face here is that when I call SubIdea::getbyId($t); the object returned is of type SuperIdea but I would like it to be of SubIdea.Is there any way to achieve it without repeating code in SubIdea? </p>