What order does php's glob function return pathnames in?

php

Solution

By default, the list is sorted ASCIIbethical in ascending order, i.e A, B, C...Z, a, b, c...z, 0,1...9. Its a copy of the libc `glob()`

Source http://www.delorie.com/djgpp/doc/libc/libc_426.html

Also the PHP source C code for glob: https://github.com/php/php-src/blob/89a9acea1f9d821a9805b3857bf4febbba08690d/win32/glob.c#L521

Problem

The documentation for glob doesn't mention what order (if any) it returns the array of pathnames in, however, it does mention a flag that allows you to disable sorting. GLOB_NOSORT - Return files as they appear in the directory (no sorting) How is the array sorted by `glob` when when the `GLOB_NOSORT` flag is not used?

Original source