Bug #80056 [NEW]: missing files when using `foreach` to iterate `RecursiveDirectoryIterator`

From: Date: Fri, 04 Sep 2020 08:02:35 +0000
Subject: Bug #80056 [NEW]: missing files when using `foreach` to iterate `RecursiveDirectoryIterator`
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228874@lists.php.net to get a copy of this message
From: 397836525 at qq dot com Operating system: Windows PHP version: 7.4.10 Package: *Directory/Filesystem functions Bug Type: Bug Bug description:missing files when using foreach to iterate RecursiveDirectoryIterator Description: ------------ I tried to use the RecursiveDirectoryIterator with the foreach funtion to get all the files below a directory, and I found some files were missing from the result.After some experiments, it seems that it only happens under the circumstance of a directory with large amount of files, like 60 or more. here's the code: <?php $directory = new RecursiveDirectoryIterator($this->path); foreach ($directory as $filename => $fileInfo) { echo $filename . PHP_EOL; } ?> please use the patch file to reproduce the bug. -- Edit bug report at https://bugs.php.net/bug.php?id=80056&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80056&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80056&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80056&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80056&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80056&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80056&r=support Expected behavior: https://bugs.php.net/fix.php?id=80056&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80056&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80056&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80056&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80056&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80056&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80056&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80056&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80056&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80056&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80056&r=mysqlcfg

« previous php.bugs (#228874) next »