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.base_convert(mt_rand(), 10, 16)); return substr($n, -$c); }; return sprintf( '%x-%s-%s-%s-%s%s%s', microtime(true) * 10000, $x($c), $x($c), $x($c), $x($c), $x($c), $x($c) ); } $time = microtime(); $uuids = array(); for ($i = 0; $i < 100; $i++) { $uuids[] = uuid(6); } if (count(array_unique($uuids)) != count($uuids)) { echo 'DUPLICATED'; } else { echo 'No duplicate'; print_r($uuids); }

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.4.00.0070.00715.04
7.3.120.0070.01115.01
7.3.110.0060.01214.79
7.3.100.0070.01015.09
7.3.90.0080.00414.72
7.3.80.0080.00814.75
7.3.70.0030.01014.91
7.3.60.0070.00714.58
7.3.50.0060.00314.85
7.3.40.0040.00814.95
7.3.30.0040.01114.98
7.3.20.0110.00416.50
7.3.10.0000.01016.70
7.3.00.0130.00316.80
7.2.250.0100.01015.38
7.2.240.0070.01415.19
7.2.230.0110.00715.27
7.2.220.0060.00615.05
7.2.210.0000.01314.93
7.2.200.0000.01414.98
7.2.190.0040.01115.11
7.2.180.0060.01015.25
7.2.170.0100.00715.11
7.2.00.0060.00619.59
7.1.330.0120.00315.98
7.1.320.0030.00915.74
7.1.310.0130.00315.96
7.1.300.0060.00315.75
7.1.290.0030.01415.88
7.1.280.0000.01515.58
7.1.270.0000.01315.82
7.1.260.0090.00615.94
7.1.70.0060.00616.93
7.1.60.0170.00719.46
7.1.50.0070.01116.68
7.1.00.0000.08022.28
7.0.200.0040.00416.67
7.0.140.0000.10022.11
7.0.60.0070.07719.96
7.0.50.0130.07017.94
7.0.40.0130.06320.11
7.0.30.0270.08320.23
7.0.20.0200.03720.23
7.0.10.0270.07020.25
7.0.00.0130.08320.19
5.6.280.0100.07021.10
5.6.210.0170.06020.66
5.6.200.0030.07018.19
5.6.190.0070.09320.64
5.6.180.0200.04320.33
5.6.170.0230.05020.52
5.6.160.0070.05020.41
5.6.150.0170.07018.14
5.6.140.0000.08718.27
5.6.130.0100.08018.16
5.6.120.0030.06021.18
5.6.110.0070.06021.02
5.6.100.0030.04721.00
5.6.90.0100.08321.00
5.6.80.0130.03020.48
5.6.70.4230.04320.41
5.5.350.0070.08320.54
5.5.340.0000.09018.07
5.5.330.0200.07020.43
5.5.320.0470.06720.24
5.5.310.0400.07720.28
5.5.300.0100.07018.04
5.5.290.0070.04317.96
5.5.280.0070.04721.01
5.5.270.0070.07320.83
5.5.260.0100.07320.80
5.5.250.0030.08720.73
5.5.240.0070.04320.22
5.4.450.0300.07019.41
5.4.440.0330.05719.49
5.4.430.0300.04719.41
5.4.420.0300.06719.48
5.4.410.0230.07319.35
5.4.400.0300.06719.21
5.4.390.1500.03719.08
5.4.380.0330.07318.96
5.4.370.0270.07319.13
5.4.360.0300.05719.00
5.4.350.0330.06319.17
5.4.340.0100.04719.13
5.4.320.0070.03812.56
5.4.310.0090.03712.56
5.4.300.0070.03712.57
5.4.290.0100.03712.56
5.4.280.0100.03412.46
5.4.270.0060.03812.45
5.4.260.0070.04012.46
5.4.250.0060.03912.46
5.4.240.0070.03712.46
5.4.230.0110.03612.45
5.4.220.0100.03512.45
5.4.210.0070.03612.45
5.4.200.0070.04012.45
5.4.190.0060.03912.45
5.4.180.0060.03912.45
5.4.170.0060.03812.46
5.4.160.0070.03712.45
5.4.150.0020.04212.45
5.4.140.0070.04012.13
5.4.130.0080.03612.12
5.4.120.0070.03612.07
5.4.110.0060.03812.07
5.4.100.0100.03412.07
5.4.90.0060.03912.07
5.4.80.0090.03612.07
5.4.70.0080.03612.07
5.4.60.0040.04012.06
5.4.50.0130.03112.06
5.4.40.0090.03412.05
5.4.30.0070.03712.05
5.4.20.0030.04012.05
5.4.10.0070.03612.05
5.4.00.0120.03211.55

preferences:
38.35 ms | 401 KiB | 5 Q