summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/bug36365.phpt
blob: be1a6c5165558f572ee6b2351df87f4dd3fe15a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
Bug #36365 (scandir duplicates file name at every 65535th file)
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
?>
--FILE--
<?php
$testdir = __DIR__ . '/bug36365';

mkdir($testdir);
for ($i = 0; $i < 70000; $i++) {
    touch(sprintf("$testdir/%05d.txt", $i));
}

var_dump(count(scandir($testdir)));
?>
--CLEAN--
<?php
$testdir = __DIR__ . '/bug36365';
for ($i = 0; $i < 70000; $i++) {
    unlink(sprintf("$testdir/%05d.txt", $i));
}
rmdir($testdir);
?>
--EXPECT--
int(70002)