use splFileInfo::getExtension()