ID: 29960
User updated by: asgarbutt at ucdavis dot edu
Reported By: asgarbutt at ucdavis dot edu
Status: Open
Bug Type: *Directory/Filesystem functions
Operating System: Windows XP Professional SP 2
PHP Version: 5.0.1
New Comment:
In my description, i wrote the wrong quote. It should be ...
Fatal error: Call to undefined method DirectoryIterator::fileType() in
C:\Apache2\htdocs\imagearchive\test.php on line 40
as stated in the Actual result section.
Previous Comments:
------------------------------------------------------------------------
[2004-09-03 00:15:34] asgarbutt at ucdavis dot edu
Description:
------------
When utilizing the new DirectoryIterator of PHP5 (5.0.1) I get the
following message.
Fatal error: Call to undefined method DirectoryIterator::fileExt() in
C:\Apache2\htdocs\imagearchive\test.php on line 40
The function is listed in the documentation but only minimumly.
Reproduce code:
---------------
$sPath = 'C:\Apache2\htdocs'
foreach (new DirectoryIterator($sPath) as $oFile) {
if ($oFile->isFile()) {
echo 'isFile => '.$oFile->isFile().'<br />';
echo 'getFilename => '.$oFile->getFilename().'<br />';
echo 'fileType => '.$oFile->fileType().'<br />';
}
}
Expected result:
----------------
isFile => 1
getFilename => apache_pb.gif
fileType => .gif (or something similar)
Actual result:
--------------
isFile => 1
getFilename => apache_pb.gif
Fatal error: Call to undefined method DirectoryIterator::fileType() in
C:\Apache2\htdocs\imagearchive\test.php on line 40
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29960&edit=1