| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2006-05-19 22:29 UTC] helly@php.net
  [2012-04-03 14:49 UTC] johndoejersey at gmail dot com
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 10:00:02 2025 UTC | 
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