#37530 [NEW]: Recursive directory iterator fails on some cases
| From: | epilock at gmail dot com | Date: | Fri, 19 May 2006 20:57:08 +0000 |
| Subject: | #37530 [NEW]: Recursive directory iterator fails on some cases | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-97390@lists.php.net to get a copy of this message | ||
From: epilock at gmail dot com
Operating system: w2k
PHP version: 5.1.5CVS
PHP Bug Type: SPL related
Bug description: Recursive directory iterator fails on some cases
Description:
------------
When calling constructor w/o flags iterator fails to return children as
iterator. children are splfileinfo instead
Uncomment second call to get working result
Reproduce code:
---------------
<?php
$it = new RecursiveDirectoryIterator( '/path/to/dir');
//$it = new RecursiveDirectoryIterator( '/path/to/dir_with_files',
RecursiveDirectoryIterator::KEY_AS_FILENAME);
foreach( $it as $file )
{
if( $file->hasChildren() )
{
echo 'has children'
}
}
?>
Expected result:
----------------
output: 'has children'
Actual result:
--------------
Fatal error: Call to undefined method SplFileInfo::getChildren() in ... on
line 5
--
Edit bug report at http://bugs.php.net/?id=37530&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37530&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37530&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37530&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37530&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37530&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37530&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37530&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37530&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37530&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37530&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37530&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37530&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37530&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37530&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37530&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37530&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37530&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37530&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37530&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37530&r=mysqlcfg