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(); } 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)
8.0.10.0090.01217.26
8.0.00.0180.00316.98
7.4.140.0060.01216.28
7.4.130.0120.00816.08
7.4.120.0180.00816.18
7.4.110.0130.00616.24
7.4.100.0150.00516.36
7.4.90.0150.01216.22
7.4.80.0180.00615.96
7.4.70.0060.01316.30
7.4.60.0070.01116.28
7.4.50.0090.00916.09
7.4.40.0120.00616.18
7.4.30.0080.01416.52
7.4.20.0130.00716.14
7.4.10.0080.01216.40
7.4.00.0280.01016.78
7.3.260.0150.00316.48
7.3.250.0140.01116.59
7.3.240.0150.01116.26
7.3.230.0110.00816.65
7.3.220.0130.01316.50
7.3.210.0110.00716.53
7.3.200.0060.01216.48
7.3.190.0110.00716.38
7.3.180.0100.01316.01
7.3.170.0170.00016.14
7.3.160.0090.00916.16
7.3.150.0040.01616.32
7.3.140.0160.00616.44
7.3.130.0090.00916.26
7.3.120.0160.00816.20
7.3.110.0120.00816.48
7.3.100.0140.00616.21
7.3.90.0150.00816.21
7.3.80.0130.00716.32
7.3.70.0210.00616.30
7.3.60.0110.01216.25
7.3.50.0090.01416.39
7.3.40.0190.00416.29
7.3.30.0200.00316.22
7.3.20.0140.01316.33
7.3.10.0050.01716.49
7.3.00.0130.01316.20
7.2.340.0230.01316.44
7.2.330.0260.00716.47
7.2.320.0200.01416.56
7.2.310.0110.01516.42
7.2.300.0140.01216.41
7.2.290.0190.00816.70
7.2.280.0260.00616.51
7.2.270.0120.01516.61
7.2.260.0230.01016.52
7.2.250.0120.01216.47
7.2.240.0220.00616.51
7.2.230.0110.01516.42
7.2.220.0170.01216.36
7.2.210.0070.01916.51
7.2.200.0170.01016.59
7.2.190.0140.01416.40
7.2.180.0320.00316.72
7.2.170.0250.00616.61
7.2.160.0210.01116.57
7.2.150.0300.00816.66
7.2.140.0230.00916.69
7.2.130.0240.00816.56
7.2.120.0240.00816.64
7.2.110.0200.01516.63
7.2.100.0150.01916.70
7.2.90.0280.00516.85
7.2.80.0250.00616.72
7.2.70.0230.01116.68
7.2.60.0280.00316.79
7.2.50.0240.00816.88
7.2.40.0230.01016.67
7.2.30.0280.01116.89
7.2.20.0120.02116.80
7.2.10.0230.01016.66
7.2.00.0260.00917.99
7.1.330.0160.00815.45
7.1.320.0570.00315.38
7.1.310.0200.00915.39
7.1.300.0170.01015.36
7.1.290.0280.00715.51
7.1.280.0170.01515.64
7.1.270.0260.00615.69
7.1.260.0250.00615.64
7.1.250.0200.01315.60
7.1.240.0220.00915.55
7.1.230.0280.00815.47
7.1.220.0190.01115.56
7.1.210.0370.00315.63
7.1.200.0240.00715.70
7.1.190.0190.01315.70
7.1.180.0210.00715.59
7.1.170.0180.01415.63
7.1.160.0260.00915.71
7.1.150.0220.01215.64
7.1.140.0130.01715.68
7.1.130.0280.00415.54
7.1.120.0190.01315.60
7.1.110.0240.00715.66
7.1.100.0170.01215.77
7.1.90.0190.01315.63
7.1.80.0190.01215.61
7.1.70.0170.00416.38
7.1.60.0170.01117.48
7.1.50.0140.01316.27
7.1.40.0260.00515.69
7.1.30.0260.00815.77
7.1.20.0250.00615.73
7.1.10.0250.00715.66
7.1.00.0180.04319.00
7.0.330.0280.00815.31
7.0.320.0270.00615.53
7.0.310.0220.00915.29
7.0.300.0180.01215.35
7.0.290.0270.00715.36
7.0.280.0260.01315.37
7.0.270.0350.01215.20
7.0.260.0270.00915.37
7.0.250.0280.00915.39
7.0.240.0230.01215.32
7.0.230.0320.00815.28
7.0.220.0270.01115.35
7.0.210.0350.00015.13
7.0.200.0130.00816.01
7.0.190.0240.01015.30
7.0.180.0210.01315.30
7.0.170.0210.01215.35
7.0.160.0280.00615.38
7.0.150.0260.00715.35
7.0.140.0170.04118.64
7.0.130.0180.02215.31
7.0.120.0310.00415.23
7.0.110.0270.00715.30
7.0.100.0160.04917.64
7.0.90.0210.04417.57
7.0.80.0220.04718.54
7.0.70.0170.04218.43
7.0.60.0160.04918.60
7.0.50.0220.04118.62
7.0.40.0210.04317.68
7.0.30.0160.04517.71
7.0.20.0120.05217.66
7.0.10.0160.04717.69
7.0.00.0190.04417.70
5.6.400.0210.01716.35
5.6.390.0280.01116.22
5.6.380.0200.01616.20
5.6.370.0180.01516.10
5.6.360.0220.01115.94
5.6.350.0280.00616.34
5.6.340.0250.01316.12
5.6.330.0280.00616.45
5.6.320.0270.00816.49
5.6.310.0260.01016.09
5.6.300.0210.01416.23
5.6.290.0170.02116.26
5.6.280.0170.04018.65
5.6.270.0180.01815.93
5.6.260.0200.01616.44
5.6.250.0210.04418.29
5.6.240.0090.04218.41
5.6.230.0210.04318.22
5.6.220.0190.04818.37
5.6.210.0180.04318.39
5.6.200.0120.04718.60
5.6.190.0190.04718.54
5.6.180.0170.04918.59
5.6.170.0230.02918.52
5.6.160.0160.04518.53
5.6.150.0160.05218.52
5.6.140.0150.05018.67
5.6.130.0180.05018.58
5.6.120.0110.03718.49
5.6.110.0200.04318.51
5.6.100.0160.04718.54
5.6.90.0120.04118.64
5.6.80.0130.05018.24
5.6.70.0190.03118.27
5.6.60.0150.04218.19
5.6.50.0140.04618.29
5.6.40.0100.04718.27
5.6.30.0120.05018.24
5.6.20.0110.04318.27
5.6.10.0160.04518.23
5.6.00.0100.05018.29
5.5.380.0200.05318.19
5.5.370.0160.03818.17
5.5.360.0180.04518.31
5.5.350.0190.04218.22
5.5.340.0170.04618.37
5.5.330.0170.04718.50
5.5.320.0200.04618.43
5.5.310.0200.03718.41
5.5.300.0200.03918.40
5.5.290.0120.05718.50
5.5.280.0170.04618.47
5.5.270.0200.04818.40
5.5.260.0170.03018.55
5.5.250.0200.04318.30
5.5.240.0150.04418.13
5.5.230.0160.04218.21
5.5.220.0150.04518.00
5.5.210.0100.05118.03
5.5.200.0170.03118.13
5.5.190.0150.04418.17
5.5.180.0130.03518.11
5.5.170.0090.01816.02
5.5.160.0090.05118.09
5.5.150.0080.05418.09
5.5.140.0100.04818.19
5.5.130.0110.04718.15
5.5.120.0150.04118.18
5.5.110.0150.04718.14
5.5.100.0090.04717.98
5.5.90.0120.04517.96
5.5.80.0130.04818.13
5.5.70.0170.04518.11
5.5.60.0210.03918.09
5.5.50.0210.03818.07
5.5.40.0150.02818.03
5.5.30.0170.04318.06
5.5.20.0200.03518.03
5.5.10.0150.05018.05
5.5.00.0170.05017.99
5.4.450.0150.04515.89
5.4.440.0210.03816.25
5.4.430.0230.03816.04
5.4.420.0110.04616.05
5.4.410.0150.03516.04
5.4.400.0080.04815.96
5.4.390.0130.04515.86
5.4.380.0060.04515.98
5.4.370.0200.03615.88
5.4.360.0120.04315.99
5.4.350.0110.03515.86
5.4.340.0110.04216.09
5.4.330.0150.01212.77
5.4.320.0120.04416.00
5.4.310.0110.03915.93
5.4.300.0090.04015.94
5.4.290.0080.04716.02
5.4.280.0090.04515.88
5.4.270.0180.03215.86
5.4.260.0100.04715.79
5.4.250.0120.04515.87
5.4.240.0110.04415.90
5.4.230.0140.04115.84
5.4.220.0160.04315.91
5.4.210.0130.04515.88
5.4.200.0140.04015.89
5.4.190.0150.03916.03
5.4.180.0120.04615.88
5.4.170.0120.02915.98
5.4.160.0160.03815.76
5.4.150.0130.07019.02
5.4.140.0070.07316.42
5.4.130.0100.07016.40
5.4.120.0100.06716.32
5.4.110.0070.06316.38
5.4.100.0100.06316.55
5.4.90.0100.04016.48
5.4.80.0100.03716.54
5.4.70.0030.07716.48
5.4.60.0100.07016.30
5.4.50.0100.06316.41
5.4.40.0100.05716.46
5.4.30.0130.06316.41
5.4.20.0100.06716.36
5.4.10.0170.06716.53
5.4.00.0070.07315.88

preferences:
30.07 ms | 401 KiB | 5 Q