best trick when using an extending class (PHP)
问题 Regarding my post here: problems when extending a PHP Class What's the best solution? And why? $query = $this->Execute("SELECT * FROM $table"); $total = $this->NumRows($query); Or $query = DBManager::Execute("SELECT * FROM $table"); $total = DBManager::NumRows($query); Or $query = parent::Execute("SELECT * FROM $table"); $total = parent::NumRows($query); 回答1: When you extend a class, the child class can call all the public and protected methods and properties of the parent class in addition