From:             pilhoon at gmail dot com
Operating system: windows
PHP version:      5.1.2
PHP Bug Type:     Directory function related
Bug description:  scandir duplicates file name at every 65535th file

Description:
------------
scandir duplicates file name at every 65535th file

Reproduce code:
---------------
I made over 260000 files in a folder.
Their names are 'f100001' ... 'f264001'.

$file_names = scandir('files/');

$base_names= array();
for($i=100001; $i<=263064; $i++)
{
        $base_names["f".$i] = 0;
}

foreach($file_names as $a_name)
{
        if(1 == $base_names[$a_name])
                echo $a_name."\n";
        else
                $base_names[$a_name] = 1;
}

Expected result:
----------------
They must be showed only once.

Actual result:
--------------
scandir(THAT_FOLDER) returns large array but
f165534 and f231069 are duplicated.



-- 
Edit bug report at http://bugs.php.net/?id=36365&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36365&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36365&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36365&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36365&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36365&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36365&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36365&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36365&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36365&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36365&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36365&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36365&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36365&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36365&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36365&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36365&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36365&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36365&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36365&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36365&r=mysqlcfg

Reply via email to