相关疑难解决方法(0)

在写上下文中不能使用方法返回值

我认为下面的代码应该可以工作,但它没有(编辑:现在适用于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

461
推荐指数
4
解决办法
24万
查看次数

标签 统计

php ×1