3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function makeRandomPath($dir, $ext) { do { $path = $dir."/".genRandomString().".".$ext; } while(file_exists($path)); return $path; } echo makeRandomPath(); function makeRandomPathFromFilename($dir, $fn) { $ext = pathinfo($fn, PATHINFO_EXTENSION); return makeRandomPath($dir, $ext); } echo makeRandomPathFromFilename();
based on XsZ3D

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.110.0390.01014.21
7.2.100.0500.00314.25
7.2.90.0360.00914.39
7.2.80.0410.00314.34
7.2.70.0400.00715.00
7.2.60.0530.00414.56
7.2.50.0690.00314.71
7.2.40.0350.01614.84
7.2.30.0540.00314.76
7.2.20.0500.00614.51
7.2.10.0470.01014.55
7.2.00.0450.00714.66
7.1.230.0490.00713.49
7.1.220.0450.00613.64
7.1.210.0400.00713.41
7.1.200.0410.00713.46
7.1.190.0430.00613.61
7.1.180.0510.00313.63
7.1.170.0430.00913.63
7.1.160.0410.00913.34
7.1.150.0530.00313.39
7.1.140.0400.01213.57
7.1.130.0440.00613.68
7.1.120.0940.00313.68
7.1.110.0490.00413.83
7.1.100.0640.00713.43
7.1.90.0520.00813.49
7.1.80.0490.01213.73
7.1.70.0520.00313.75
7.1.60.0570.00631.87
7.1.50.0610.01031.62
7.1.40.0670.01331.68
7.1.30.0610.01931.71
7.1.20.1300.00731.52
7.1.10.0560.00413.42
7.1.00.0510.00313.38
7.0.280.0580.00013.33
5.6.380.0120.00813.71