return $time;
}
+ /**
+ * @param ...$files string
+ * @return string|null
+ */
+ public static function firstThatExists(...$files){
+ foreach ($files as $file) {
+ if(file_exists($file)){
+ return $file;
+ }
+ }
+ return null;
+ }
+
}
\ No newline at end of file
}
return null;
}
+
+ /**
+ * @param $expression
+ * @param $return
+ * @return string|void
+ */
+ public static function var_export($expression, $return = false)
+ {
+ $export = var_export($expression, TRUE);
+ $export = preg_replace("/^([ ]*)(.*)/m", '$1$1$2', $export);
+ $array = preg_split("/\r\n|\n|\r/", $export);
+ $array = preg_replace(["/\s*array\s\($/", "/\)(,)?$/", "/\s=>\s$/"], [NULL, ']$1', ' => ['], $array);
+ $export = implode(PHP_EOL, array_filter(["["] + $array));
+ if ($return) return $export; else echo $export;
+ }
}