運行的服務器:php 5.2.17,啓用了XMLReader的libxml 2.7.8。PHP XMLReader - 訪問ELEMENT常量但獲取T_PAAMAYIM_NEKUDOTAYIM錯誤
問題是,當我嘗試使用$ xmlReader :: ELEMENT時,它抱怨使用T_PAAMAYIM_NEKUDOTAYIM解析錯誤。
是否有任何此行爲被引入的特定版本?因爲它似乎好工作我的離線5.3.6服務器上...
$xmlReader = new XMLReader;
if (!$xmlReader->open('file.xml', null, 1<<19)){
throw new Exception('Unable to read file',1);
}
# Go down to WEBRESOURCES node level
while ($xmlReader::ELEMENT){ // This is what it throws the parse error for
if ($xmlReader->name == "blahblah"){
break;
}
$xmlReader->read();
}
感謝,大教堂
謝謝,這個固定。我有一個四處看看,似乎我正在嘗試只是> 5.3。我能讀到這裏嗎?謝謝:) –
@Dominic http://php.net/manual/en/language.oop5.paamayim-nekudotayim.php – Gordon