public static function lastChange($dirs, Cache $cache = NULL, &$cache_key = "") {
        $files = call_user_func_array("array_merge", array_map(function($dir) {
            if(!is_dir($dir)) return [];
            return iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)));
        }, (array)$dirs));

        if(!$files) {
            return NULL;
        }

        $files = array_filter($files, function($file) { return !is_link($file); });

        usort($files, function($a, $b) { return $b->getMTime() - $a->getMTime(); });

        if(!$cache) {
            return $files[0];
        }

        $lastchange = $files[0]->getMTime();

        $cache_key = "Loops-Misc-filesChanged-".implode("-", $dirs);

        if($cache->contains($cache_key)) {
            $mtime = $cache->fetch($cache_key);
        }
        else {
            $mtime = FALSE;
        }

        $cache->save($cache_key, $lastchange);

        if($mtime != $lastchange) {
            return $files[0];
        }

        return NULL;
    }