1. 程式人生 > >Call to a member function fetch() on null

Call to a member function fetch() on null

public function __construct()
{   parent::__construct();
    $this->userid = 1;
}

public function index()
{
    return $this->fetch();
}

大概率是 __construct()裡面的parent這個東西沒新增