|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81669 DirectoryIterator ignore files
Submitted: 2021-11-28 13:46 UTC Modified: 2021-11-29 10:06 UTC
From: wapinet at mail dot ru Assigned:
Status: Closed Package: *Directory/Filesystem functions
PHP Version: 8.0.13 OS: Alpine Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: wapinet at mail dot ru
New email:
PHP Version: OS:


 [2021-11-28 13:46 UTC] wapinet at mail dot ru
DirectoryIterator (and RecursiveDirectoryIterator) returns fewer files than should be in some cases.
But scandir/opendir+readdir returns all files.
It produces only in alpine linux in my tests. centos/windows doesn't have the problem.

Test script:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-28 16:15 UTC] antonino dot spampinato86 at gmail dot com
Maybe it is irrelevant but if you set the index directly is it always an element?

$arr = array(0 => null);
$i = 0;
//example foreach
while($i < 5) {
$arr[0] = 'value';
$arr = $arr + array($i => 'value');
 [2021-11-29 10:05 UTC] wapinet at mail dot ru
-Status: Open +Status: Closed
 [2021-11-29 10:05 UTC] wapinet at mail dot ru
most likely it's bug of docker-win. not php
 [2021-11-29 10:06 UTC] wapinet at mail dot ru
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Feb 04 13:03:38 2023 UTC