What exactly are the benefits of using a PHP 5 DirectoryIterator
$dir = new DirectoryIterator(dirname(__FILE__)); foreach ($dir as $fileinfo) { // handle wh
It's shorter, cleaner and easier to type and read.
Try re-read your examples. Just “for each in $dir” in first example.
$dir
What you want, that you write…