From: Operating system: applies to all (OpenBSD for me) PHP version: 5.3.3 Package: Directory function related Bug Type: Feature/Change Request Bug description:make scandir()'s directory sorting optional
Description: ------------ --- >From manual page: http://www.php.net/function.scandir --- Currently, scandir() commits some "userland villainry" by enforcing alphanumerical sorting of the directory entries it pulls. In some cases I needed a "natural" order of the entries in a directory. In another more obvious case, scandir() created notable CPU overhead from always sorting entries in a rather huge directory that was frequently read in the application. I had to go back to PHP4's opendir/readdir to solve the problem. I'd like to suggest that scandir() gets new constants introduced to $sorting_order in order to make the sorting optional: something like SORT_NONE, SORT_ASCENDING and SORT_DESCENDING. -- Edit bug report at http://bugs.php.net/bug.php?id=53407&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53407&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53407&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53407&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53407&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53407&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53407&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53407&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53407&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53407&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53407&r=support Expected behavior: http://bugs.php.net/fix.php?id=53407&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53407&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53407&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53407&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53407&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53407&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53407&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53407&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53407&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53407&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53407&r=mysqlcfg