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-%04s-%04s-%04s-%04s%04s%04s', 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)
7.4.10.0060.01215.01
7.4.00.0030.01514.95
7.3.130.0130.00315.13
7.3.120.0060.01214.71
7.3.110.0040.01515.00
7.3.100.0120.00014.66
7.3.90.0150.00314.74
7.3.80.0070.00414.87
7.3.70.0070.01014.96
7.3.60.0060.00914.88
7.3.50.0060.00614.61
7.3.40.0090.00614.87
7.3.30.0040.00814.75
7.3.20.0060.00916.68
7.3.10.0100.00816.58
7.3.00.0140.00716.28
7.2.260.0100.00715.05
7.2.250.0100.01015.08
7.2.240.0120.00615.21
7.2.230.0110.00715.05
7.2.220.0070.01014.84
7.2.210.0040.01215.06
7.2.200.0070.01015.13
7.2.190.0060.01215.15
7.2.180.0030.01015.22
7.2.170.0060.00614.93
7.2.160.0080.00815.19
7.2.150.0090.00617.01
7.2.140.0030.01017.03
7.2.130.0120.01116.83
7.2.120.0140.00616.89
7.2.110.0070.01216.86
7.2.100.0080.00816.55
7.2.90.0100.00616.88
7.2.80.0090.00916.95
7.2.70.0050.01116.84
7.2.60.0090.00516.99
7.2.50.0040.01316.84
7.2.40.0050.01416.81
7.2.30.0080.00816.75
7.2.20.0090.00716.80
7.2.10.0110.00916.72
7.2.00.0090.00617.69
7.1.330.0070.00715.95
7.1.320.0080.00815.91
7.1.310.0150.00015.84
7.1.300.0090.00015.96
7.1.290.0120.00315.68
7.1.280.0070.00715.92
7.1.270.0060.00915.75
7.1.260.0030.00615.74
7.1.250.0100.00615.53
7.1.240.0090.00915.98
7.1.230.0090.00615.81
7.1.220.0110.00315.80
7.1.210.0040.01215.84
7.1.200.0090.00615.94
7.1.190.0040.00815.95
7.1.180.0000.01315.75
7.1.170.0110.00315.75
7.1.160.0090.00615.60
7.1.150.0030.01015.86
7.1.140.0000.01315.84
7.1.130.0030.00715.58
7.1.120.0070.00715.63
7.1.110.0080.00615.71
7.1.100.0000.00915.84
7.1.90.0120.00315.56
7.1.80.0090.00915.60
7.1.70.0070.00716.44
7.1.60.0090.01117.68
7.1.50.0120.00916.30
7.1.40.0080.00715.70
7.1.30.0060.01315.71
7.1.20.0060.00915.79
7.1.10.0090.00615.89
7.1.00.0050.04119.04
7.0.330.0060.00615.48
7.0.320.0110.00815.43
7.0.310.0030.01615.50
7.0.300.0090.00615.20
7.0.290.0040.01515.45
7.0.280.0060.00615.39
7.0.270.0080.00815.55
7.0.260.0060.00915.13
7.0.250.0040.00815.41
7.0.240.0030.01215.55
7.0.230.0070.01315.53
7.0.220.0120.00415.23
7.0.210.0000.01515.18
7.0.200.0070.00416.13
7.0.190.0100.01015.36
7.0.180.0030.01415.46
7.0.170.0100.01015.56
7.0.160.0090.00615.48
7.0.150.0030.01315.24
7.0.140.0050.04118.65
7.0.130.0140.00315.20
7.0.120.0000.01415.65
7.0.110.0040.00715.48
7.0.100.0040.01215.52
7.0.90.0100.00715.58
7.0.80.0090.00615.55
7.0.70.0090.00615.55
7.0.60.0030.02817.75
7.0.50.0060.03016.78
7.0.40.0090.02716.86
7.0.30.0150.04616.98
7.0.20.0140.04516.71
7.0.10.0060.02516.80
7.0.00.0090.04416.87
5.6.400.0040.01514.52
5.6.390.0080.00814.62
5.6.380.0090.00614.49
5.6.370.0060.01314.65
5.6.360.0000.01114.11
5.6.350.0090.00914.76
5.6.340.0070.01014.52
5.6.330.0030.01514.47
5.6.320.0110.00714.49
5.6.310.0030.01514.24
5.6.300.0070.01014.58
5.6.290.0110.00314.68
5.6.280.0080.04117.99
5.6.270.0030.01214.61
5.6.260.0040.01214.38
5.6.250.0150.00414.25
5.6.240.0150.00414.34
5.6.230.0040.01114.69
5.6.220.0030.01314.52
5.6.210.0080.04317.69
5.6.200.0050.02516.26
5.6.190.0070.04717.57
5.6.180.0200.02817.62
5.6.170.0250.02017.32
5.6.160.0030.02517.53
5.6.150.0100.04316.23
5.6.140.0030.02416.37
5.6.130.0050.02616.27
5.6.120.0050.04017.58
5.6.110.0030.04617.74
5.6.100.0100.04217.84
5.6.90.0110.04317.61
5.6.80.0050.03717.49
5.6.70.0040.01514.34
5.6.60.0060.01214.28
5.6.50.0030.01314.26
5.6.40.0120.00614.45
5.6.30.0030.01714.37
5.6.20.0070.01314.27
5.6.10.0100.00714.52
5.6.00.0070.01114.34
5.5.380.0040.00814.36
5.5.370.0000.01014.46
5.5.360.0110.00714.21
5.5.350.0120.04717.38
5.5.340.0050.02316.31
5.5.330.0120.02017.46
5.5.320.0250.03717.34
5.5.310.0190.03117.36
5.5.300.0070.02716.21
5.5.290.0070.03416.11
5.5.280.0120.02017.64
5.5.270.0030.04817.60
5.5.260.0080.03317.59
5.5.250.0050.03117.46
5.5.240.0140.04017.07
5.5.230.0040.00814.57
5.5.220.0140.00414.29
5.5.210.0100.00714.37
5.5.200.0060.00914.45
5.5.190.0100.00714.59
5.5.180.0080.01114.36
5.5.170.0080.00814.26
5.5.160.0070.01314.52
5.5.150.0040.01414.59
5.5.140.0070.00714.27
5.5.130.0060.01214.35
5.5.120.0000.01514.37
5.5.110.0090.00914.10
5.5.100.0060.01314.39
5.5.90.0070.00414.50
5.5.80.0090.00614.52
5.5.70.0070.00714.29
5.5.60.0040.01514.25
5.5.50.0030.01614.30
5.5.40.0110.00414.50
5.5.30.0070.01014.38
5.5.20.0000.01214.27
5.5.10.0140.00314.38
5.5.00.0120.00914.35
5.4.450.0150.02915.30
5.4.440.0170.03415.28
5.4.430.0100.02315.40
5.4.420.0090.02615.27
5.4.410.0070.02315.40
5.4.400.0070.02515.04
5.4.390.0120.02515.28
5.4.380.0200.03715.03
5.4.370.0120.03714.95
5.4.360.0230.03714.97
5.4.350.0230.03114.99
5.4.340.0320.03014.94
5.4.330.0070.00711.10
5.4.320.0040.02811.83
5.4.310.0090.02111.97
5.4.300.0060.03211.92
5.4.290.0100.02911.93
5.4.280.0080.02511.80
5.4.270.0070.02411.79
5.4.260.0060.02611.75
5.4.250.0080.02311.94
5.4.240.0050.02511.69
5.4.230.0080.02411.78
5.4.220.0070.02311.73
5.4.210.0040.02411.90
5.4.200.0090.02111.82
5.4.190.0070.02411.72
5.4.180.0070.02311.80
5.4.170.0080.02311.82
5.4.160.0070.02111.83
5.4.150.0060.02111.71
5.4.140.0050.02411.62
5.4.130.0050.02611.68
5.4.120.0080.02111.70
5.4.110.0040.02611.47
5.4.100.0100.01711.48
5.4.90.0080.02511.55
5.4.80.0070.02211.70
5.4.70.0100.01811.64
5.4.60.0070.02411.69
5.4.50.0070.02311.65
5.4.40.0040.02311.63
5.4.30.0050.02611.66
5.4.20.0120.01911.69
5.4.10.0070.02111.59
5.4.00.0050.02411.43
5.3.290.0070.04212.80
5.3.280.0060.04112.73
5.3.270.0130.03612.75
5.3.260.0070.04212.74
5.3.250.0050.04112.74
5.3.240.0090.03812.74
5.3.230.0120.05012.73
5.3.220.0070.04112.70
5.3.210.0110.05312.70
5.3.200.0080.05212.70
5.3.190.0080.03912.70
5.3.180.0110.03512.70
5.3.170.0120.03412.70
5.3.160.0100.03512.70
5.3.150.0070.04312.70
5.3.140.0060.04112.70
5.3.130.0090.03912.68
5.3.120.0050.04312.68
5.3.110.0050.04512.68
5.3.100.0070.04412.17
5.3.90.0080.04012.15
5.3.80.0080.04012.14
5.3.70.0070.03912.14
5.3.60.0100.04612.13
5.3.50.0070.03712.08
5.3.40.0080.04012.08
5.3.30.0110.04012.04
5.3.20.0100.03311.82
5.3.10.0080.03511.78
5.3.00.0080.03611.77
5.2.170.0070.0319.22
5.2.160.0070.0279.21
5.2.150.0050.0319.22
5.2.140.0040.0329.21
5.2.130.0050.0289.18
5.2.120.0020.0319.17
5.2.110.0030.0319.18
5.2.100.0050.0289.18
5.2.90.0080.0269.18
5.2.80.0040.0319.17
5.2.70.0050.0309.18
5.2.60.0030.0319.12
5.2.50.0070.0289.09
5.2.40.0040.0299.07
5.2.30.0040.0309.05
5.2.20.0030.0309.05
5.2.10.0080.0258.95
5.2.00.0050.0298.81
5.1.60.0040.0248.09
5.1.50.0050.0248.08
5.1.40.0040.0248.06
5.1.30.0060.0248.43
5.1.20.0050.0258.44
5.1.10.0060.0258.16
5.1.00.0050.0278.16
5.0.50.0050.0216.64
5.0.40.0060.0166.50
5.0.30.0040.0316.31
5.0.20.0020.0216.28
5.0.10.0020.0216.26
5.0.00.0020.0326.25
4.4.90.0050.0134.78
4.4.80.0060.0124.75
4.4.70.0010.0174.76
4.4.60.0030.0154.75
4.4.50.0040.0144.77
4.4.40.0010.0274.71
4.4.30.0040.0154.76
4.4.20.0020.0174.84
4.4.10.0040.0154.85
4.4.00.0000.0284.76
4.3.110.0020.0174.67
4.3.100.0020.0154.67
4.3.90.0010.0164.63
4.3.80.0030.0244.58
4.3.70.0050.0154.63
4.3.60.0030.0184.62
4.3.50.0030.0154.63
4.3.40.0040.0234.54
4.3.30.0020.0163.30
4.3.20.0020.0163.27
4.3.10.0020.0163.24
4.3.00.0000.02018.23

preferences:
36.63 ms | 401 KiB | 5 Q