3v4l.org

run code in 200+ PHP versions simultaneously
<?php function createTempDir(): ?string { $separator = DIRECTORY_SEPARATOR; $path = rtrim(sys_get_temp_dir(), $separator) . $separator . mt_rand() . microtime(true); $createdTempDir = mkdir($path); if ($createdTempDir) { return $path; } return null; } var_dump(createTempDir());
based on g5Klm