Bug #81669 [Opn->Csd]: DirectoryIterator ignore files
| From: | wapinet at mail dot ru | Date: | Mon, 29 Nov 2021 10:05:30 +0000 |
| Subject: | Bug #81669 [Opn->Csd]: DirectoryIterator ignore files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-238034@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81669&edit=1
ID: 81669
User updated by: wapinet at mail dot ru
Reported by: wapinet at mail dot ru
Summary: DirectoryIterator ignore files
-Status: Open
+Status: Closed
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Alpine Linux
PHP Version: 8.0.13
Block user comment: N
Private report: N
New Comment:
most likely it's bug of docker-win. not php
Previous Comments:
------------------------------------------------------------------------
[2021-11-28 16:15:50] 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-28 13:46:32] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81669&edit=1