禁止使用test类的就是禁止使用本来的$this对象.可以调用父类的对象

public function __construct() {
parent::__construct( );

parent::__construct( );
if(!APP_DEBUG )
die('not supported now'); //上一行没有分号.默认安装一行来算
}

public function liyan() {

$this->display();
}

Call to a member function display() on a non-object

$this->不是对象.构造方法里面禁止了本类的$this对象.需要调用父类的构造方法.创建对象

原文地址:https://www.cnblogs.com/bj-tony/p/5604138.html