From:             asgarbutt at ucdavis dot edu
Operating system: Windows XP Professional SP 2
PHP version:      5.0.1
PHP Bug Type:     *Directory/Filesystem functions
Bug description:  DirectoryIterator::fileType

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 bug report at http://bugs.php.net/?id=29960&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=29960&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29960&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29960&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=29960&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=29960&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=29960&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=29960&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=29960&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=29960&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=29960&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=29960&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=29960&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=29960&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=29960&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=29960&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=29960&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=29960&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=29960&r=float

Reply via email to