我认为下面的代码应该可以工作,但它没有(编辑:现在适用于PHP 5.5+):
if (!empty($r->getError()))
Run Code Online (Sandbox Code Playgroud)
其中getError()无非是:
public function getError()
{
return $this->error;
}
Run Code Online (Sandbox Code Playgroud)
但我最终得到了这个错误:
不能在写上下文中使用方法返回值
这是什么意思?这不仅仅是一个阅读?
php ×1