3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uuid($c = 4) { $x = function($c) { for ($n = ''; strlen($n) < $c + 1; $n = $n.mt_rand()); return substr($n, -$c); }; return sprintf( '%s-%04d-%04d-%04d-%04d%04d', microtime(), $x($c), $x($c), $x($c), $x($c), $x($c), $x($c) ); } $time = microtime(); $uuids = array(); for ($i = 0; $i < 10000; $i++) { $uuids[] = uuid(); } if (count(array_unique($uuids)) != count($uuids)) { echo 'DUPLICATE'; } else { echo 'No duplicate'; }

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).

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.0070.02121.04
7.1.60.0170.05321.16
7.1.50.0030.05120.76
7.1.00.0030.11726.36
7.0.200.0070.03120.74
7.0.140.0200.09726.00
7.0.60.0070.09724.02
7.0.50.0030.11721.67
7.0.40.0070.06020.25
7.0.30.0130.07020.37
7.0.20.0200.07320.10
7.0.10.0070.08020.23
7.0.00.0030.10720.16
5.6.280.0100.15026.00
5.6.210.0130.14025.61
5.6.200.0130.14323.04
5.6.190.0000.14025.29
5.6.180.0200.10725.25
5.6.170.0370.14025.06
5.6.160.0230.13325.29
5.6.150.0070.09323.02
5.6.140.0070.08723.01
5.6.130.0170.07323.02
5.6.120.0130.14025.91
5.6.110.0000.14326.01
5.6.100.0070.09725.89
5.6.90.0030.14326.04
5.6.80.0070.11725.26
5.5.350.0100.10725.33
5.5.340.0130.14022.84
5.5.330.0170.14025.05
5.5.320.3400.13025.11
5.5.310.0200.14325.13
5.5.300.0100.08722.86
5.5.290.0000.12322.93
5.5.280.0070.10325.70
5.5.270.0030.09325.83
5.5.260.0130.11325.74
5.5.250.0100.14325.50
5.5.240.0030.13025.11
5.4.450.0070.13024.01
5.4.440.0270.12023.99
5.4.430.0270.11024.37
5.4.420.0170.12724.23
5.4.410.0170.09323.91
5.4.400.0270.10724.07
5.4.390.0200.12323.93
5.4.380.0270.14024.07
5.4.370.0270.12023.90
5.4.360.0130.09723.91
5.4.350.0200.09323.91
5.4.340.0270.12324.05
5.4.320.0200.08323.96
5.4.310.0270.12023.69
5.4.300.0200.12023.82
5.4.290.0200.09323.91
5.4.280.0170.09023.91
5.4.270.0330.10323.93
5.4.260.0100.12023.67
5.4.250.0300.08023.95
5.4.240.0230.13324.05
5.4.230.0230.12723.71
5.4.220.0100.09723.96
5.4.210.0270.07724.14
5.4.200.0200.08323.95
5.4.190.0230.08023.90
5.4.180.0200.08723.87
5.4.170.0300.12323.95
5.4.160.0230.09023.81
5.4.150.0200.11023.89
5.4.140.0230.09021.20
5.4.130.0200.08321.23
5.4.120.0170.09021.18
5.4.110.0270.13021.35
5.4.100.0230.08321.46
5.4.90.0200.14021.44
5.4.80.0170.10321.32
5.4.70.0000.08721.34
5.4.60.0070.09321.40
5.4.50.0830.07321.14
5.4.40.1830.08021.30
5.4.30.1700.09021.24
5.4.20.1670.07321.29
5.4.10.2130.09021.43
5.4.00.1830.08320.77
5.3.290.2000.09319.47
5.3.280.1830.08719.32
5.3.270.1430.09019.42
5.3.260.2130.09019.34
5.3.250.1930.09019.32
5.3.240.2100.11719.27
5.3.230.2070.09019.26
5.3.220.2000.09319.23
5.3.210.1970.09719.34
5.3.200.2030.11719.29
5.3.190.2170.09719.52
5.3.180.1830.09019.38
5.3.170.1300.08319.20
5.3.160.0030.09019.51
5.3.150.0130.08319.20
5.3.140.1270.07719.34
5.3.130.2500.09019.20
5.3.120.1770.09019.15
5.3.110.1830.09319.36
5.3.100.2170.13318.77
5.3.90.1830.09018.68
5.3.80.1830.08718.83
5.3.70.1830.08718.83
5.3.60.1770.09318.82
5.3.50.1930.09318.77
5.3.40.1630.09718.69
5.3.30.2030.08318.65
5.3.20.1770.08718.82
5.3.10.1770.09018.38
5.3.00.2070.08018.45
5.2.170.1670.02311.15
5.2.160.1670.02711.09
5.2.150.1400.03711.04
5.2.140.1770.03311.27
5.2.130.0670.03011.18
5.2.120.0000.03311.01
5.2.110.0000.03011.01
5.2.100.0000.03011.25
5.2.90.1900.03011.07
5.2.80.1530.03011.10
5.2.70.1570.02711.02
5.2.60.1500.03311.05
5.2.50.1500.03010.98
5.2.40.1230.02711.13
5.2.30.1130.03310.88
5.2.20.1100.03310.96
5.2.10.1170.03010.94
5.2.00.1170.03010.61
5.1.60.1170.0239.97
5.1.50.1230.0179.98
5.1.40.1370.03010.03
5.1.30.1230.02010.24
5.1.20.1200.02710.27
5.1.10.1200.02710.07
5.1.00.1230.0279.96
5.0.50.0670.0278.54
5.0.40.0600.0208.48
5.0.30.0700.0378.20
5.0.20.0630.0278.30
5.0.10.0700.0308.17
5.0.00.0670.0338.14
4.4.90.0800.0208.14
4.4.80.0630.0178.14
4.4.70.0530.0208.14
4.4.60.0430.0138.14
4.4.50.0700.0178.14
4.4.40.0570.0278.14
4.4.30.0600.0178.14
4.4.20.0700.0238.14
4.4.10.0800.0138.14
4.4.00.0730.0378.14
4.3.110.0800.0238.14
4.3.100.0800.0238.14
4.3.90.0630.0178.14
4.3.80.0770.0378.14
4.3.70.0800.0208.14
4.3.60.0770.0278.14
4.3.50.0770.0208.14
4.3.40.0800.0338.14
4.3.30.0300.0208.14
4.3.20.0400.0278.14
4.3.10.0430.0308.14
4.3.00.0330.0238.14

preferences:
28.4 ms | 400 KiB | 5 Q