我发现以下奇怪的错误。
-
意外的php错误[c:\documents and settings\yepthatsme\my documents\dev\nicnames\main\resources\includes\name.in c.php line 180]中的[use of undefined constant s-assumed's']severity[e\u notice]
它所指的行具有:
$types = nicnames_config::$resourcetypes;
nicnames_config::$resourcetypes是一个数组。我不知道它所说的“s”是从哪里来的,我开始认为这可能是一个PHP bug,尽管也许我错过了一些东西。我该去哪里看看?
我使用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();
}
编辑:问题现在解决了,看我自己的答案。