0
我收到以下奇怪的錯誤。獲取我無法弄清楚的「使用未定義常量」錯誤
- 意外的PHP錯誤[未定義常數s的使用 - 假設的']嚴重性[E_NOTICE]在[C:\ Documents和Settings \ yepthatsme \我的文檔\開發\ nicnames \主\資源\包括\名稱.inc.php線180]
它指的是該生產線具有:
$types = nicnames_config::$resourcetypes;
nicnames_config :: $ resourcetypes是一個數組。我不知道這裏談到的是來自哪裏,我開始認爲它可能是一個PHP錯誤,但也許我錯過了一些東西。我應該在哪裏看?
我正在使用SimpleTest進行測試,並且在特定測試期間發生此錯誤。
如果你有興趣,這裏是在上下文中該行:
function getstrings()
// returns array of strings suitable for human-readable rendering of this
// piece of informtion. Contains such fields as 'title', 'subtitle',
// 'pre-qualifier', 'post-qualifier', 'comment', etc
{
$types = nicnames_config::$resourcetypes; // line 180
$type = isset($types['name_type'][$this->type]) ?
$types['name_type'][$this->type] : $this->type;
$givens = $this->givennames == '' ? null : $this->givennames;
return array(
'title' => $this->surnamefirst ? ($this->surname . ',') : $givens,
'subtitle' => $this->surnamefirst ? $givens : $this->surname,
'pre-qualifier' => $type,
'post-qualifier' => $this->title == '' ? null : ('(' . $this->title . ')'),
) + $this->getcommonstrings();
}
編輯:問題是現在解決了,看到我自己的答案。
whats class nicnames_config {}是什麼樣的? – scott 2009-08-03 07:12:39