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 base_convert(substr($n, -$c), 10, 16); }; return sprintf( '%x-%04x-%04x-%04x-%04x%04x%04x', 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.3.10.0070.01016.20
7.3.00.0110.00716.10
7.2.130.0190.00416.88
7.2.120.0150.00916.88
7.2.110.0110.01116.82
7.2.100.0130.01316.54
7.2.90.0100.01016.73
7.2.80.0140.00716.26
7.2.70.0040.01716.67
7.2.60.0200.00816.93
7.2.50.0100.0079.42
7.2.40.0060.01316.36
7.2.30.0090.0099.70
7.2.20.0110.00316.78
7.2.10.0090.00916.75
7.2.00.0020.01417.98
7.1.250.0110.00615.73
7.1.70.0000.00917.19
7.1.60.0070.01819.46
7.1.50.0140.01016.99
7.1.00.0070.07022.27
7.0.200.0040.00416.59
7.0.140.0030.07722.05
7.0.60.0000.04319.94
7.0.50.0070.05717.89
7.0.40.0070.05020.09
7.0.30.0400.04720.23
7.0.20.0300.06720.26
7.0.10.0100.08320.07
7.0.00.0170.07320.20
5.6.280.0070.07021.10
5.6.210.0200.07720.58
5.6.200.0100.03718.16
5.6.190.0100.07720.61
5.6.180.0400.07320.46
5.6.170.0130.04720.45
5.6.160.0070.04020.50
5.6.150.0100.08318.19
5.6.140.0070.03718.19
5.6.130.0100.05718.18
5.6.120.0100.04720.84
5.6.110.0030.05321.02
5.6.100.0030.08020.99
5.6.90.0070.08021.01
5.6.80.0130.06320.46
5.5.350.0300.07320.46
5.5.340.0100.03318.08
5.5.330.0000.05320.47
5.5.320.0470.04320.24
5.5.310.0400.07320.51
5.5.300.0100.03718.06
5.5.290.0070.05317.99
5.5.280.0000.04320.84
5.5.270.0170.07720.87
5.5.260.0000.09720.96
5.5.250.0030.04020.73
5.5.240.0200.05020.31
5.4.450.0470.05319.50
5.4.440.0300.05019.39
5.4.430.0100.05019.54
5.4.420.0200.04019.41
5.4.410.0070.05019.51
5.4.400.0200.03018.95
5.4.390.0100.05019.19
5.4.380.0300.05718.64
5.4.370.0300.05718.75
5.4.360.0300.05318.72
5.4.350.0230.06318.61
5.4.340.0370.05718.68
5.4.320.0040.03912.57
5.4.310.0090.03812.56
5.4.300.0070.04412.56
5.4.290.0100.03812.55
5.4.280.0100.03412.46
5.4.270.0090.03512.46
5.4.260.0100.03612.46
5.4.250.0080.04312.45
5.4.240.0090.03612.46
5.4.230.0070.03912.45
5.4.220.0040.04312.45
5.4.210.0070.04112.45
5.4.200.0020.04512.45
5.4.190.0070.03812.44
5.4.180.0090.03512.45
5.4.170.0100.03512.45
5.4.160.0090.04012.45
5.4.150.0130.03912.45
5.4.140.0060.04012.12
5.4.130.0090.04112.12
5.4.120.0100.03612.07
5.4.110.0090.03712.07
5.4.100.0100.03512.07
5.4.90.0110.04412.07
5.4.80.0060.05612.07
5.4.70.0120.03212.07
5.4.60.0050.03912.07
5.4.50.0100.03412.07
5.4.40.0100.03412.05
5.4.30.0110.03312.05
5.4.20.0090.03612.05
5.4.10.0060.03712.05
5.4.00.0160.04511.55
5.3.290.0080.04112.80
5.3.280.0120.03612.73
5.3.270.0080.04012.75
5.3.260.0100.03912.75
5.3.250.0050.04012.74
5.3.240.0100.03712.74
5.3.230.0080.03912.73
5.3.220.0060.04112.71
5.3.210.0090.03812.70
5.3.200.0090.03712.70
5.3.190.0070.03912.70
5.3.180.0090.03712.70
5.3.170.0100.03512.70
5.3.160.0090.03612.70
5.3.150.0090.03712.70
5.3.140.0040.04112.69
5.3.130.0110.03712.68
5.3.120.0060.04212.68
5.3.110.0090.03812.69
5.3.100.0100.03612.17
5.3.90.0070.03812.17
5.3.80.0050.04012.14
5.3.70.0050.04012.15
5.3.60.0060.03912.13
5.3.50.0110.03412.09
5.3.40.0120.03312.08
5.3.30.0080.03612.04
5.3.20.0060.03811.82
5.3.10.0050.04011.79
5.3.00.0070.03711.77
5.2.170.0050.0289.21
5.2.160.0040.0289.22
5.2.150.0060.0289.21
5.2.140.0050.0299.21
5.2.130.0050.0289.17
5.2.120.0050.0289.17
5.2.110.0040.0299.18
5.2.100.0040.0299.18
5.2.90.0050.0309.18
5.2.80.0050.0299.18
5.2.70.0050.0299.17
5.2.60.0060.0289.12
5.2.50.0070.0279.09
5.2.40.0050.0309.07
5.2.30.0050.0319.05
5.2.20.0050.0319.04
5.2.10.0030.0398.95
5.2.00.0040.0308.81
5.1.60.0070.0218.09
5.1.50.0030.0258.08
5.1.40.0040.0248.07
5.1.30.0080.0258.43
5.1.20.0070.0238.44
5.1.10.0020.0288.16
5.1.00.0040.0268.16
5.0.50.0030.0216.64
5.0.40.0030.0256.50
5.0.30.0040.0306.31
5.0.20.0050.0176.29
5.0.10.0040.0196.25
5.0.00.0040.0306.25
4.4.90.0020.0164.78
4.4.80.0010.0174.75
4.4.70.0030.0154.76
4.4.60.0030.0164.75
4.4.50.0030.0154.77
4.4.40.0020.0254.70
4.4.30.0040.0144.76
4.4.20.0020.0164.84
4.4.10.0040.0144.85
4.4.00.0020.0264.76
4.3.110.0020.0164.67
4.3.100.0060.0164.66
4.3.90.0030.0164.64
4.3.80.0030.0254.59
4.3.70.0050.0124.63
4.3.60.0050.0144.63
4.3.50.0020.0164.63
4.3.40.0030.0244.54
4.3.30.0000.0183.30
4.3.20.0040.0143.28
4.3.10.0020.0153.24
4.3.00.0000.01318.23

preferences:
36.41 ms | 401 KiB | 5 Q