title: Can I create object of child class using method from parent class
body: <p>So I have this parent class:</p>
  
  <pre><code>    class Table {
  
      protected static $table_name;
      protected static $tbl_columns=array();
  
      public static function instance($row_from_db){
          $object=new self;
          foreach (self::$tbl_columns as $key=&gt;$property){
              $object-&gt;$property =    $row_from_db[$property];
          }
          return $object;
      }
   }
  </code></pre>
  
  <p>When I call "instance" method in some child class of class Table it generates the object of class Table not the object of child class.</p>
  
  <p>Is there some way to do that with this code? Or any advice on how you would solve it? Thanks</p>