Bug #81669 [Com]: DirectoryIterator ignore files

From: Date: Sun, 28 Nov 2021 16:15:51 +0000
Subject: Bug #81669 [Com]: DirectoryIterator ignore files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238017@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 Comment by: antonino dot spampinato86 at gmail dot com Reported by: wapinet at mail dot ru Summary: DirectoryIterator ignore files Status: Open Type: Bug Package: *Directory/Filesystem functions Operating System: Alpine Linux PHP Version: 8.0.13 Block user comment: N Private report: N New Comment: 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); Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#238017) next »