Not to be a stickler but ++$var is faster then $var++
By approximately 0.00000004 seconds each time. I'd say it's a moot point in this particular case when accessing the file system is the slowest operation occurring.
Originally Posted by CHASE
Glob will only return files of a certain extension, and supports only two arguments though.. This does an entire directory + sub directories :D
glob will return whatever you tell it to return. If you just specify * as the pattern, glob will return all files and directories in the current working directory. It's simple enough to check for directories and go through each recursively, as you do in your own code.