- scandir: documentation ( source)
- touch: documentation ( source)
- str_pad: documentation ( source)
<?php
$dir = './';
$total = PHP_INT_MAX + 1337;
for ($i = 0; $i < $total; ++$i) {
$filename = $dir . str_pad($i, 6, '0', STR_PAD_LEFT);
touch($filename);
}
$files = scandir($dir);
echo 'scandir: ' . (count($files) - 2) . '/' . $total. PHP_EOL;