When Refectring the current statmement

By saeed ahmed

When I try to refecter commented into the static method, its return null. Other wise its ok. why ?

    public static  function Table($input) {
      $name = 'gazett_'.$input['ExamYear'].'_'.$input['gender'].'_'.$input['Examtype'];
      //        $obj = new static;
      //        $obj->setTable($name);
      //        return $obj; if i return insetance its ok, but in given below its return null why ?
      return (new static)->setTable($name);

Here how return current instance from static method ?

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273