我遇到了有时发生的严重问题。错误消息是'致命错误:对/var/www/quantum-framework-0.9.1-ns-alpha/class/log/LogFacility.class.php中的非对象上的成员函数调用已过去()第40行
这是代码 - 第40行是$ this-> timer-> elapsed() - thing:
public function __construct() {
parent::__construct();
$this->timer = new \core\base\Timing();
print_r($this);
$this->timer_start = $this->timer->elapsed();
[...]
}
print_r($ this)的输出是:
core\log\LogFacility Object
(
[level:core\log\LogFacility:private] => TRACE
[file:core\log\LogFacility:private] =>
[filename:core\log\LogFacility:private] =>
[enabled:core\log\LogFacility:private] =>
[timer:core\log\LogFacility:private] => core\base\Timing Object
(
[start:core\base\Timing:private] => 1371141304.0793
[stop:core\base\Timing:private] => 0
[q:core\base\Quobject:private] =>
[supported_vars:protected] => Array
(
)
)
[timer_start:core\log\LogFacility:private] =>
[logs:core\log\LogFacility:private] => Array
(
)
[supported_vars:protected] => Array
(
[0] => level
[1] => filename
[2] => enabled
)
[q:core\base\Quobject:private] => core\log\LogFacility
)
那么,怎么会发生这种情况呢?请记住,错误有时只发生 - 主要是当我更改了与此时序测量功能无关的其他文件时,此外(如您所见)我创建的对象只存在于上面一行。
哦,顺便说一下,elapsed()方法是公开的。
谢谢你的答案!