|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 03:00:01 2025 UTC |
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);