php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wapinet at mail dot ru
New email:
PHP Version: OS:

 

 [2021-11-28 13:46 UTC] wapinet at mail dot ru
Description:
------------
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:
---------------
https://github.com/Gemorroj/php-directoryiterator-bug


Patches

Pull Requests

History

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) {
if(is_null($arr[0]))
$arr[0] = 'value';
$arr = $arr + array($i => 'value');
++$i;
}
var_dump($arr);
 [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
https://github.com/docker/for-win/issues/12405
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 06:01:32 2025 UTC