我寫的是使用來自標準PHP庫(SPL)的FilterIterator類的腳本,我得到不同的behabours翻過PHP 5.x版本:(這裏accept()函數:PHP中的DirectoryIterator + FilterIterator行爲不一致?
public function accept()
{
$current = $this->current();
print_r($current);
return true;
}
和其繼承人對PHP 5.3.1輸出:
DirectoryIterator Object
(
[pathName:SplFileInfo:private] => /Users/alex/Sites/dev/php/fscms/content/.
[fileName:SplFileInfo:private] => .
[glob:DirectoryIterator:private] =>
[subPathName:RecursiveDirectoryIterator:private] =>
)
DirectoryIterator Object
(
[pathName:SplFileInfo:private] => /Users/alex/Sites/dev/php/fscms/content/..
[fileName:SplFileInfo:private] => ..
[glob:DirectoryIterator:private] =>
[subPathName:RecursiveDirectoryIterator:private] =>
)
DirectoryIterator Object
(
[pathName:SplFileInfo:private] => /Users/alex/Sites/dev/php/fscms/content/.DS_Store
[fileName:SplFileInfo:private] => .DS_Store
[glob:DirectoryIterator:private] =>
[subPathName:RecursiveDirectoryIterator:private] =>
)
和繼承人什麼我也要用同樣的代碼讓PHP 5.2.5下
DirectoryIterator Object
(
)
DirectoryIterator Object
(
)
DirectoryIterator Object
(
)
後者爲每任務755在所有文件上。怎麼了dat?
是的,我看到了,但類存在的事實意味着__必須正確安裝,否?所以我猜測版本之間的實現必須有某種改變。 另外,它的共享主機,所以我不能控制它。我希望在「平均」服務器上調試腳本以使其更加健壯。 – CpILL 2010-01-18 18:44:33
aslo,我有 php_flag display_errors在我的.htaccess文件上 。沒有錯誤出現:< – CpILL 2010-01-18 18:46:28
是的,這真的很奇怪......也許別人可以參與進來。 – 2010-01-18 19:20:30