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 'DUPLICATE'; } 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.0130.00717.08
8.0.00.0220.00016.96
7.4.140.0140.01016.48
7.4.130.0150.00616.57
7.4.120.0170.00816.63
7.4.110.0100.01116.32
7.4.100.0120.01216.50
7.4.90.0140.01016.56
7.4.80.0150.01116.59
7.4.70.0090.00916.54
7.4.60.0060.01316.57
7.4.50.0150.00416.38
7.4.40.0130.00616.43
7.4.30.0130.00616.57
7.4.20.0110.00716.38
7.4.10.0130.00916.36
7.4.00.0070.01416.41
7.3.260.0130.00616.57
7.3.250.0130.01016.60
7.3.240.0150.00316.48
7.3.230.0110.00716.77
7.3.220.0100.01616.34
7.3.210.0080.01116.10
7.3.200.0100.01016.29
7.3.190.0130.00716.52
7.3.180.0120.00816.36
7.3.170.0060.01316.70
7.3.160.0090.01216.61
7.3.150.0160.00316.35
7.3.140.0120.00616.52
7.3.130.0090.01016.45
7.3.120.0060.01216.47
7.3.110.0080.01216.44
7.3.100.0130.00716.65
7.3.90.0140.00716.50
7.3.80.0110.01416.51
7.3.70.0120.01316.53
7.3.60.0070.01716.18
7.3.50.0130.00516.60
7.3.40.0100.00616.52
7.3.30.0040.01516.43
7.3.20.0100.01016.42
7.3.10.0160.01016.54
7.3.00.0130.00916.41
7.2.340.0230.01316.68
7.2.330.0300.00416.73
7.2.320.0200.01416.82
7.2.310.0170.01416.91
7.2.300.0240.00816.59
7.2.290.0250.01316.67
7.2.280.0270.01416.86
7.2.270.0240.01416.51
7.2.260.0150.02316.70
7.2.250.0260.00916.58
7.2.240.0310.00516.71
7.2.230.0170.01716.71
7.2.220.0330.00316.57
7.2.210.0330.00916.59
7.2.200.0290.01416.66
7.2.190.0270.01416.70
7.2.180.0270.00616.48
7.2.170.0220.01616.69
7.2.160.0270.00916.70
7.2.150.0160.01616.87
7.2.140.0190.01116.64
7.2.130.0120.02216.66
7.2.120.0160.01516.72
7.2.110.0700.00816.56
7.2.100.0210.00616.49
7.2.90.0190.00916.52
7.2.80.0160.01116.59
7.2.70.0100.01816.47
7.2.60.0160.00816.68
7.2.50.0190.00816.64
7.2.40.0210.00716.62
7.2.30.0450.01316.74
7.2.20.0150.01016.66
7.2.10.0200.01116.61
7.2.00.0120.00817.67
7.1.330.0350.00615.59
7.1.320.0210.01115.59
7.1.310.0250.00615.86
7.1.300.0280.01115.62
7.1.290.0290.01015.59
7.1.280.0280.00515.43
7.1.270.0250.00615.72
7.1.260.0210.01115.71
7.1.250.0150.01515.47
7.1.240.0250.00715.54
7.1.230.0140.01215.46
7.1.220.0190.00715.70
7.1.210.0100.01415.62
7.1.200.0140.01015.63
7.1.190.0200.00915.53
7.1.180.0120.00915.63
7.1.170.0150.00715.62
7.1.160.0110.01715.65
7.1.150.0120.01115.54
7.1.140.0160.00815.50
7.1.130.0160.00815.32
7.1.120.0110.01515.69
7.1.110.0160.00915.66
7.1.100.0230.00715.72
7.1.90.0190.00715.76
7.1.80.0230.00915.76
7.1.70.0150.00416.11
7.1.60.0150.01116.98
7.1.50.0180.01016.11
7.1.40.0190.01015.61
7.1.30.0230.01115.80
7.1.20.0210.00815.77
7.1.10.0170.00915.70
7.1.00.0140.03317.80
7.0.330.0160.01015.25
7.0.320.0210.01215.25
7.0.310.0240.01215.05
7.0.300.0180.00915.34
7.0.290.0230.00515.34
7.0.280.0170.00715.20
7.0.270.0230.01115.13
7.0.260.0170.01415.12
7.0.250.0240.00915.41
7.0.240.0190.00915.36
7.0.230.0120.01015.39
7.0.220.0130.01215.20
7.0.210.0290.00915.14
7.0.200.0150.00615.75
7.0.190.0140.01415.40
7.0.180.0160.00915.20
7.0.170.0150.00915.39
7.0.160.0150.01115.24
7.0.150.0250.00715.41
7.0.140.0110.03117.56
7.0.130.0120.01415.22
7.0.120.0150.01015.29
7.0.110.0150.01215.35
7.0.100.0120.01415.24
7.0.90.0240.01115.32
7.0.80.0160.01215.00
7.0.70.0200.01415.26
7.0.60.0160.01916.66
7.0.50.0150.02615.98
7.0.40.0130.03516.18
7.0.30.0220.01816.28
7.0.20.0210.03516.20
7.0.10.0150.03716.29
7.0.00.0170.02716.11
5.6.400.0220.01415.45
5.6.390.0290.02016.01
5.6.380.0160.01215.28
5.6.370.0200.01015.16
5.6.360.0150.01115.14
5.6.350.0170.01615.24
5.6.340.0240.00415.03
5.6.330.0190.00815.23
5.6.320.0170.01314.90
5.6.310.0110.01415.31
5.6.300.0180.01215.36
5.6.290.0110.01315.23
5.6.280.0150.03317.13
5.6.270.0160.01215.20
5.6.260.0260.00915.16
5.6.250.0140.01515.17
5.6.240.0170.01414.96
5.6.230.0190.00815.02
5.6.220.0140.01415.23
5.6.210.0130.02216.90
5.6.200.0150.02016.18
5.6.190.0120.03816.96
5.6.180.0170.02416.94
5.6.170.0230.02116.83
5.6.160.0200.01716.83
5.6.150.0150.03416.17
5.6.140.0170.01816.18
5.6.130.0190.03316.20
5.6.120.0160.03016.99
5.6.110.0150.03017.13
5.6.100.0160.03317.07
5.6.90.0130.03917.06
5.6.80.0160.03216.82
5.6.70.0170.01315.08
5.6.60.0180.00714.98
5.6.50.0160.01014.93
5.6.40.0170.00915.25
5.6.30.0150.01215.22
5.6.20.0200.01215.02
5.6.10.0260.00515.23
5.6.00.0150.01115.35
5.5.380.0210.00613.68
5.5.370.0170.01013.61
5.5.360.0180.00913.81
5.5.350.0170.03715.90
5.5.340.0140.01914.87
5.5.330.0200.02315.81
5.5.320.0130.03215.82
5.5.310.0200.03315.77
5.5.300.0120.01814.92
5.5.290.0160.03114.99
5.5.280.0130.03615.93
5.5.270.0160.03516.03
5.5.260.0170.03516.04
5.5.250.0140.03116.03
5.5.240.0200.03015.90
5.5.230.0170.01213.70
5.5.220.0150.01313.51
5.5.210.0210.00813.51
5.5.200.0170.00913.63
5.5.190.0160.01213.52
5.5.180.0170.01313.54
5.5.170.0150.01115.14
5.5.160.0190.00513.63
5.5.150.0190.00713.53
5.5.140.0090.01613.60
5.5.130.0150.01213.73
5.5.120.0170.00813.63
5.5.110.0170.01213.54
5.5.100.0150.00913.76
5.5.90.0170.01013.68
5.5.80.0160.01013.60
5.5.70.0150.01113.71
5.5.60.0180.01113.54
5.5.50.0150.01113.73
5.5.40.0140.01213.60
5.5.30.0160.01013.63
5.5.20.0170.00913.72
5.5.10.0160.01513.65
5.5.00.0110.01413.58
5.4.450.0140.02414.33
5.4.440.0260.02314.49
5.4.430.0180.01914.54
5.4.420.0140.01714.57
5.4.410.0100.01814.50
5.4.400.0150.01714.40
5.4.390.0140.01914.48
5.4.380.0330.02414.18
5.4.370.0270.02714.28
5.4.360.0240.02614.31
5.4.350.0220.02414.27
5.4.340.0210.02514.18
5.4.330.0120.00912.01
5.4.320.0110.01912.27
5.4.310.0110.02112.17
5.4.300.0140.01912.23
5.4.290.0150.01812.14
5.4.280.0110.01812.11
5.4.270.0110.02012.31
5.4.260.0130.01812.16
5.4.250.0110.02212.16
5.4.240.0110.01912.14
5.4.230.0070.02212.12
5.4.220.0140.02212.04
5.4.210.0090.01912.21
5.4.200.0140.01712.01
5.4.190.0140.01912.10
5.4.180.0110.01912.08
5.4.170.0100.02112.06
5.4.160.0120.01812.07
5.4.150.0080.02011.90
5.4.140.0060.02411.53
5.4.130.0070.02211.68
5.4.120.0100.01811.47
5.4.110.0050.02311.82
5.4.100.0100.02011.62
5.4.90.0100.01911.51
5.4.80.0080.02211.73
5.4.70.0070.02311.53
5.4.60.0070.02211.65
5.4.50.0100.02411.63
5.4.40.0090.02611.59
5.4.30.0090.02011.46
5.4.20.0120.01811.48
5.4.10.0070.02011.37
5.4.00.0080.02211.21

preferences:
40.57 ms | 401 KiB | 5 Q