Php and directory listing

has thousand of useful built-in functions. But it lacks in directory listing. Listing files by creation date can be an awful experience. How can be possible for such a great language like PHP to not have this kind of built-in parameters for scandir or readdir functions? They implemented SCANDIR_SORT_ASCENDING and SCANDIR_SORT_DESCENDING for alphabetical file ordering, but if we want date order we MUST use a custom not efficient array sorting method.

Very bad.