note 102660 added to function.glob
[email protected] Sun, 27 Feb 2011 07:25:09 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
Regarding the so called "fastest way":
"glob" is up to ten (!) times slower than any other internal php function! If you are really interested in FAST directory walking, use "scandir" instead!
Try it for yourself!
$t0 = microtime(true);
$files = glob($path.'/*');
$t1 = microtime(true);
echo "glob('".$path."/*') : ".($t1 - $t0)."\r\n";
print_r($files);
$t0 = microtime(true);
$files = scandir($path);
$t1 = microtime(true);
echo "scandir('".$path."'): ".($t1 - $t0)."\r\n";
print_r($files);
----
Server IP: 217.160.235.204
Probable Submitter: 94.223.142.182
----
Manual Page -- http://www.php.net/manual/en/function.glob.php
Edit -- https://master.php.net/note/edit/102660
Del: integrated -- https://master.php.net/note/delete/102660/integrated
Del: useless -- https://master.php.net/note/delete/102660/useless
Del: bad code -- https://master.php.net/note/delete/102660/bad+code
Del: spam -- https://master.php.net/note/delete/102660/spam
Del: non-english -- https://master.php.net/note/delete/102660/non-english
Del: in docs -- https://master.php.net/note/delete/102660/in+docs
Del: other reasons-- https://master.php.net/note/delete/102660
Reject -- https://master.php.net/note/reject/102660
Search -- https://master.php.net/manage/user-notes.php