Bug #74358 [Opn->Fbk]: FilesystemIterator repeats file entry at 65535, 65535*2 etc positions

From: Date: Sat, 01 Apr 2017 10:59:19 +0000
Subject: Bug #74358 [Opn->Fbk]: FilesystemIterator repeats file entry at 65535, 65535*2 etc positions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208251@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74358&edit=1 ID: 74358 Updated by: requinix@php.net Reported by: xtpd17 at gmail dot com Summary: FilesystemIterator repeats file entry at 65535, 65535*2 etc positions -Status: Open +Status: Feedback Type: Bug Package: SPL related Operating System: Windows 7 PHP Version: 5.6.30 Block user comment: N Private report: N New Comment: I can repro in 5.6 but not 7.0 or 7.1. Can you? 5.6 is no longer in active support so this wouldn't be fixed there. Previous Comments: ------------------------------------------------------------------------ [2017-04-01 10:25:38] xtpd17 at gmail dot com Description: ------------ When FilesystemIterator iterates through folder with many files, it doubles file entries at 65535th and, more generally, 65535*n+(n-1) positions (131071,196607...). ... 65533.txt 65534.txt // ok 65534.txt // omg what happened with my file system, is it broken? But chkdsk shows nothing bad. Oh well, it's just iterator... 65535.txt 65536.txt ... 7.0.0 and later versions work fine. Test script: --------------- 1) to generate many files in one folder use batch like for /l %a in (1 1 200000) do type nul > "%a.txt" 2) $path = 'd:\pathtoyour\folder'; $items = new FilesystemIterator($path,FilesystemIterator::CURRENT_AS_PATHNAME); $n = 0; $name = ''; foreach ($items as $item) { $name_prev = $name; $name = basename($item); $n++; if ($name == $name_prev) echo "DUPILCATE ENTRY FOUND AT $n: $name <br>"; } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74358&edit=1

« previous php.bugs (#208251) next »