Bug #79633 [NEW]: readdir skips entries

From: Date: Tue, 26 May 2020 02:03:17 +0000
Subject: Bug #79633 [NEW]: readdir skips entries
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227162@lists.php.net to get a copy of this message
From: keith at ksmith dot com Operating system: Ubuntu 18.04, Others PHP version: Irrelevant Package: Directory function related Bug Type: Bug Bug description:readdir skips entries Description: ------------ root@nas-2:/volume1/admin/bin# mkdir /volume1/media/testfolder/0 root@nas-2:/volume1/admin/bin# mkdir /volume1/media/testfolder/1 root@nas-2:/volume1/admin/bin# mkdir /volume1/media/testfolder/2 root@nas-2:/volume1/admin/bin# mkdir /volume1/media/testfolder/3 root@nas-2:/volume1/admin/bin# mkdir /volume1/media/testfolder/4 root@nas-2:/volume1/admin/bin# mkdir /volume1/media/testfolder/5 root@nas-2:/volume1/admin/bin# ls /volume1/media/testfolder 0 1 2 3 4 5 root@nas-2:/volume1/admin/bin# php PHP-test.php Array ( [0] => .. [1] => 1 [2] => 3 [3] => 4 [4] => 5 ) See Code below Test script: --------------- #!/usr/bin/php <?php $cur_folder = "/volume1/media/testfolder"; $dirp = opendir($cur_folder); while($entry = readdir($dirp)) { $entry_list[] = $entry; } sort($entry_list); print_r($entry_list); ?> Expected result: ---------------- I would expect to see the entries: "." and "2" -- Edit bug report at https://bugs.php.net/bug.php?id=79633&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79633&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79633&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79633&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79633&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79633&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79633&r=support Expected behavior: https://bugs.php.net/fix.php?id=79633&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79633&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79633&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79633&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79633&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79633&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79633&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79633&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79633&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79633&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79633&r=mysqlcfg

« previous php.bugs (#227162) next »