insert($item); } } public function compare($b,$a) { /** * @var $a SplFileInfo * @var $b SplFileInfo */ return strcmp($a->getPath() . DIRECTORY_SEPARATOR . $a->getFileName(), $b->getPath() . DIRECTORY_SEPARATOR . $b->getFileName()); } }