我正在做一个 Zend 项目,自从我接触 Zend 以来已经超过 12 个月了,我的一个功能出现错误,我无法弄清楚原因,我认为这可能取决于最初构建的站点在早期版本的 PHP (5.2) 中,我现在正在运行 5.3。
函数看起来像这样,
public function addDebug($mixedObject, $title = "")
{
$debugObject = new stdClass();
$debugObject->title = $title;
$debugObject->type = gettype($mixedObject);
$debugObject->className = (!get_class($mixedObject)) ? "" : gettype($mixedObject);<-- Line error is complaining about -->
$debugObject->mixedObject = $mixedObject;
array_push($this->debugArr, $debugObject);
}
错误信息如下,
get_class() expects parameter 1 to be object, array given in /server/app/lib/View.php on line 449
关于这个问题的任何建议都会很好。