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%04d', time(), $x($c), $x($c), $x($c), $x($c), $x($c), $x($c), $x($c) ); } $uuids = array(); for ($i = 0; $i < 1000; $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.4.00.0100.00615.41
7.3.120.0120.01215.18
7.3.110.0100.01315.48
7.3.100.0000.01815.43
7.3.90.0030.00915.33
7.3.80.0060.01215.18
7.3.70.0150.00415.38
7.3.60.0000.01815.34
7.3.50.0100.00715.06
7.3.40.0030.01314.98
7.3.30.0040.01515.08
7.3.20.0090.00316.55
7.3.10.0000.01316.67
7.3.00.0060.00616.39
7.2.250.0000.02515.68
7.2.240.0120.01215.63
7.2.230.0120.00615.61
7.2.220.0060.01215.61
7.2.210.0090.01515.73
7.2.200.0040.01515.45
7.2.190.0030.01415.26
7.2.180.0000.01815.54
7.2.170.0070.01415.54
7.1.330.0000.02115.84
7.1.320.0030.01715.96
7.1.310.0150.00915.84
7.1.300.0040.01515.80
7.1.290.0000.01815.52
7.1.280.0000.01815.98
7.1.270.0040.01515.66
7.1.260.0030.01415.84
7.1.70.0030.00617.00
7.1.60.0130.01619.46
7.1.50.0130.01617.02
7.1.00.0070.07322.35
7.0.200.0030.00916.56
7.0.140.0000.08321.92
7.0.90.0030.04021.74
7.0.80.0130.02721.71
7.0.70.0030.08321.80
7.0.60.0000.08321.88
7.0.50.0070.08322.14
7.0.40.0070.09020.13
7.0.30.0030.05720.17
7.0.20.0100.08020.14
7.0.10.0130.07020.10
7.0.00.0100.07020.05
5.6.280.0000.08721.18
5.6.240.0000.04720.82
5.6.230.0070.07021.01
5.6.220.0030.05720.85
5.6.210.0070.06720.78
5.6.200.0000.08721.39
5.6.190.0070.08021.40
5.6.180.0030.05721.23
5.6.170.0030.08721.57
5.6.160.0030.09021.31
5.6.150.0070.05321.37
5.6.140.0070.05721.22
5.6.130.0000.10021.22
5.6.120.0070.05321.36
5.6.110.0130.04721.21
5.6.100.0070.08721.34
5.6.90.0030.08321.40
5.6.80.0030.08320.63
5.6.70.0030.08720.60
5.6.60.0130.05720.77
5.6.50.0030.08720.73
5.6.40.0070.09020.69
5.6.30.0030.08320.60
5.6.20.0000.05320.81
5.6.10.0070.09020.57
5.6.00.0030.08320.58
5.5.380.0030.04320.86
5.5.370.0000.04720.70
5.5.360.0070.08320.70
5.5.350.0070.09020.73
5.5.340.0100.09021.09
5.5.330.0070.08321.05
5.5.320.0030.08321.16
5.5.310.0070.09020.93
5.5.300.0130.07721.09
5.5.290.0000.05721.12
5.5.280.0100.08321.06
5.5.270.0030.05721.16
5.5.260.0030.09321.18
5.5.250.0100.08720.83
5.5.240.0030.07320.47
5.5.230.0100.08320.40
5.5.220.0000.06020.48
5.5.210.0170.04320.52
5.5.200.0070.04720.39
5.5.190.0000.07020.44
5.5.180.0000.05020.51
5.5.160.0100.06020.55
5.5.150.0100.07720.36
5.5.140.0030.08720.43
5.5.130.0030.08320.41
5.5.120.0000.09020.54
5.5.110.0070.08320.52
5.5.100.0070.08720.46
5.5.90.0030.09020.38
5.5.80.0030.09020.30
5.5.70.0030.09020.38
5.5.60.0070.04020.31
5.5.50.0030.06020.34
5.5.40.0000.08020.20
5.5.30.0070.07320.38
5.5.20.0030.05720.20
5.5.10.0100.04320.30
5.5.00.0000.09720.32
5.4.450.0100.08719.45
5.4.440.0030.09019.41
5.4.430.0070.04719.48
5.4.420.0100.08319.60
5.4.410.0030.08719.45
5.4.400.0030.08319.21
5.4.390.0030.06019.41
5.4.380.0100.05319.25
5.4.370.0000.09019.16
5.4.360.0000.09319.61
5.4.350.0030.05019.33
5.4.340.0030.06019.27
5.4.320.0070.07319.18
5.4.310.0070.07719.24
5.4.300.0030.08319.26
5.4.290.0030.08319.25
5.4.280.0100.06319.43
5.4.270.0030.05319.31
5.4.260.0070.08019.11
5.4.250.0030.06719.11
5.4.240.0070.08019.32
5.4.230.0070.07319.09
5.4.220.0030.06319.11
5.4.210.0070.05319.11
5.4.200.0070.07019.20
5.4.190.0000.08019.30
5.4.180.0000.04319.11
5.4.170.0100.04319.33
5.4.160.0030.06019.56
5.4.150.0070.07019.24
5.4.140.0070.08016.53
5.4.130.0030.07716.64
5.4.120.0030.07316.62
5.4.110.0000.08716.92
5.4.100.0030.08316.76
5.4.90.0100.05016.69
5.4.80.0030.07716.62
5.4.70.0030.05016.67
5.4.60.0100.07316.73
5.4.50.0000.08316.55
5.4.40.0030.08316.70
5.4.30.0100.07716.70
5.4.20.0030.04016.56
5.4.10.0000.08716.63
5.4.00.0030.06316.13
5.3.290.0070.08315.22
5.3.280.0000.08315.18
5.3.270.0030.05715.23
5.3.260.0070.05015.16
5.3.250.0030.04015.16
5.3.240.0000.05015.03
5.3.230.0000.08015.18
5.3.220.0000.08315.12
5.3.210.0030.06315.13
5.3.200.0100.06314.98
5.3.190.0030.08315.09
5.3.180.0100.03714.98
5.3.170.0000.08015.07
5.3.160.0030.08315.07
5.3.150.0030.08315.02
5.3.140.0070.08314.98
5.3.130.0130.04314.99
5.3.120.0000.06015.02
5.3.110.0030.05315.16
5.3.100.0070.07014.46
5.3.90.0000.08014.61
5.3.80.0030.07714.56
5.3.70.0030.05314.42
5.3.60.0030.04714.54
5.3.50.0070.08314.38
5.3.40.0000.08714.42
5.3.30.0070.07014.39
5.3.20.0000.07714.17
5.3.10.0070.07314.06
5.3.00.0030.07314.21
5.2.170.0070.06311.15
5.2.160.0000.05711.24
5.2.150.0030.03311.25
5.2.140.0030.05711.05
5.2.130.0100.05711.00
5.2.120.0030.05711.15
5.2.110.0000.06311.19
5.2.100.0070.05711.09
5.2.90.0070.05311.19
5.2.80.0100.05311.20
5.2.70.0070.06011.14
5.2.60.0030.06311.05
5.2.50.0070.06711.11
5.2.40.0030.06011.02
5.2.30.0030.06011.03
5.2.20.0030.05710.97
5.2.10.0030.05710.96
5.2.00.0100.05710.78
5.1.60.0030.05010.41
5.1.50.0030.05010.41
5.1.40.0000.03010.41
5.1.30.0000.05310.41
5.1.20.0000.06010.41
5.1.10.0030.04310.41
5.1.00.0030.05710.41
5.0.50.0000.02710.41
5.0.40.0070.04010.41
5.0.30.0070.06010.41
5.0.20.0000.04310.41
5.0.10.0030.03710.41
5.0.00.0030.05010.41
4.4.90.0030.03310.41
4.4.80.0000.03710.41
4.4.70.0030.03310.41
4.4.60.0030.02710.41
4.4.50.0070.02710.41
4.4.40.0070.05010.41
4.4.30.0030.03010.41
4.4.20.0030.03310.41
4.4.10.0030.03310.41
4.4.00.0070.05010.41
4.3.110.0000.02310.41
4.3.100.0000.02710.41
4.3.90.0000.02710.41
4.3.80.0000.05010.41
4.3.70.0070.03010.41
4.3.60.0030.03010.41
4.3.50.0000.02710.41
4.3.40.0030.04310.41
4.3.30.0000.02710.41
4.3.20.0030.01710.41
4.3.10.0030.03310.41
4.3.00.0070.03010.41

preferences:
37.9 ms | 400 KiB | 5 Q