3v4l.org

run code in 300+ 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());
Output for 7.4.0
string(29) "/tmp/3821167481569575074.0003"
Output for 7.3.12
string(30) "/tmp/12615800621569575074.0003"
Output for 7.3.11
string(29) "/tmp/7829242361569575074.0002"
Output for 7.3.10
string(30) "/tmp/12645812791569575074.0003"
Output for 7.3.9
string(30) "/tmp/12668329941569575074.0002"
Output for 7.3.8
string(30) "/tmp/20685882641569575074.0003"
Output for 7.3.7
string(28) "/tmp/757594481569575074.0002"
Output for 7.3.6
string(29) "/tmp/1935288251569575074.0002"
Output for 7.3.5
string(28) "/tmp/769040431569575074.0002"
Output for 7.3.4
string(29) "/tmp/9519769421569575074.0003"
Output for 7.3.3
string(30) "/tmp/19696897391569575074.0003"
Output for 7.3.2
string(30) "/tmp/18099358531569575074.0002"
Output for 7.3.1
string(29) "/tmp/5998371011569575074.0002"
Output for 7.3.0
string(30) "/tmp/10758589381569575074.0001"
Output for 7.2.25
string(30) "/tmp/12752626031569575074.0002"
Output for 7.2.24
string(29) "/tmp/3583957711569575074.0002"
Output for 7.2.23
string(28) "/tmp/987695191569575074.0002"
Output for 7.2.22
string(29) "/tmp/3740939141569575074.0002"
Output for 7.2.21
string(30) "/tmp/19116118361569575074.0003"
Output for 7.2.20
string(30) "/tmp/14923572771569575074.0002"
Output for 7.2.19
string(30) "/tmp/15378621751569575074.0002"
Output for 7.2.18
string(30) "/tmp/14578138711569575074.0002"
Output for 7.2.17
string(29) "/tmp/8607676421569575074.0002"
Output for 7.2.16
string(29) "/tmp/7751529821569575074.0107"
Output for 7.2.15
string(30) "/tmp/12203355971569575074.0025"
Output for 7.2.14
string(30) "/tmp/18604907701569575074.0003"
Output for 7.2.13
string(30) "/tmp/20938984761569575074.0003"
Output for 7.2.12
string(30) "/tmp/20232607871569575074.0002"
Output for 7.2.11
string(29) "/tmp/9362643721569575074.0154"
Output for 7.2.10
string(29) "/tmp/4595291331569575074.0063"
Output for 7.2.9
string(30) "/tmp/16247033701569575074.0052"
Output for 7.2.8
string(30) "/tmp/21344107681569575074.0027"
Output for 7.2.7
string(29) "/tmp/8272269081569575074.0005"
Output for 7.2.6
string(29) "/tmp/6772498911569575074.0003"
Output for 7.2.5
string(30) "/tmp/18701558061569575074.0047"
Output for 7.2.4
string(30) "/tmp/19632086141569575074.0014"
Output for 7.2.3
string(30) "/tmp/12766194091569575074.0002"
Output for 7.2.2
string(29) "/tmp/9267821241569575074.0017"
Output for 7.2.1
string(29) "/tmp/6116813541569575074.0005"
Output for 7.2.0
string(30) "/tmp/16379275341569575074.0002"
Output for 7.1.33
string(29) "/tmp/7180593671569575074.0002"
Output for 7.1.32
string(29) "/tmp/5053188241569575074.0001"
Output for 7.1.31
string(30) "/tmp/10314881871569575074.0002"
Output for 7.1.30
string(29) "/tmp/1250168491569575074.0001"
Output for 7.1.29
string(30) "/tmp/11313744081569575074.0003"
Output for 7.1.28
string(30) "/tmp/13416068071569575074.0001"
Output for 7.1.27
string(29) "/tmp/2064225441569575074.0002"
Output for 7.1.26
string(30) "/tmp/13253039011569575074.0001"
Output for 7.1.25
string(30) "/tmp/13609569681569575074.0003"

preferences:
29.97 ms | 476 KiB | 5 Q