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-%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.4.00.0040.01415.11
7.3.120.0120.00615.17
7.3.110.0070.01314.82
7.3.100.0080.00814.64
7.3.90.0000.01214.80
7.3.80.0030.01314.85
7.3.70.0030.01314.96
7.3.60.0060.00615.11
7.3.50.0000.01014.79
7.3.40.0030.01314.90
7.3.30.0000.01414.88
7.3.20.0030.01316.79
7.3.10.0030.01116.79
7.3.00.0070.00816.67
7.2.250.0070.01415.28
7.2.240.0070.01314.90
7.2.230.0040.01114.94
7.2.220.0100.00315.04
7.2.210.0050.00914.95
7.2.200.0060.00915.17
7.2.190.0030.01315.08
7.2.180.0000.01314.98
7.2.170.0040.00715.15
7.2.130.0000.01117.07
7.2.120.0060.01016.98
7.2.110.0000.01617.12
7.2.100.0060.00916.93
7.2.90.0050.00817.14
7.2.80.0100.00317.02
7.2.70.0000.01816.89
7.2.60.0040.01517.03
7.2.50.0040.00817.04
7.2.40.0060.00917.08
7.2.30.0000.01416.67
7.2.20.0030.00717.08
7.2.10.0100.00716.72
7.2.00.0030.00716.92
7.1.330.0040.01115.93
7.1.320.0030.01215.85
7.1.310.0070.00315.91
7.1.300.0030.01215.84
7.1.290.0040.01115.78
7.1.280.0000.01816.04
7.1.270.0000.01515.96
7.1.260.0060.00316.02
7.1.250.0070.00715.76
7.1.70.0030.00617.07
7.1.60.0130.01319.46
7.1.50.0030.02216.70
7.1.00.0030.07722.30
7.0.200.0030.00616.66
7.0.140.0070.07021.98
7.0.60.0070.03719.87
7.0.50.0100.06018.00
7.0.40.0170.04320.24
7.0.30.0330.03720.15
7.0.20.0270.07020.33
7.0.10.0000.04720.25
7.0.00.0030.06720.07
5.6.280.0070.07020.90
5.6.210.0070.09020.65
5.6.200.0000.04318.29
5.6.190.0230.07020.47
5.6.180.0300.08320.46
5.6.170.0300.04320.51
5.6.160.0130.04320.48
5.6.150.0030.06018.21
5.6.140.0070.03718.19
5.6.130.0070.04718.26
5.6.120.0070.04020.96
5.6.110.0170.07021.02
5.6.100.0030.08320.98
5.6.90.0130.07321.00
5.6.80.0130.07720.44
5.5.350.0330.06720.40
5.5.340.0000.04317.96
5.5.330.0070.08720.39
5.5.320.0000.05720.29
5.5.310.0330.03720.39
5.5.300.0130.07718.08
5.5.290.0070.07318.06
5.5.280.0030.04320.80
5.5.270.0070.07720.81
5.5.260.0030.09720.66
5.5.250.0070.05020.70
5.5.240.0270.06320.18
5.4.450.0270.05019.28
5.4.440.0570.05319.32
5.4.430.0270.04019.47
5.4.420.0030.05019.19
5.4.410.0130.04319.18
5.4.400.0100.03319.16
5.4.390.0230.03719.24
5.4.380.0430.06018.62
5.4.370.0270.06018.64
5.4.360.0370.05018.64
5.4.350.0530.08018.77
5.4.340.0300.06318.79
5.4.320.0060.03912.56
5.4.310.0070.05012.56
5.4.300.0070.04012.56
5.4.290.0090.04112.56
5.4.280.0090.03612.46
5.4.270.0100.04412.46
5.4.260.0090.04312.45
5.4.250.0080.03812.46
5.4.240.0080.03612.46
5.4.230.0090.03712.45
5.4.220.0080.03712.45
5.4.210.0110.03412.45
5.4.200.0070.03912.45
5.4.190.0060.04012.45
5.4.180.0090.03612.45
5.4.170.0030.04012.45
5.4.160.0090.03612.45
5.4.150.0030.04212.45
5.4.140.0070.03912.13
5.4.130.0090.04112.12
5.4.120.0110.03612.08
5.4.110.0080.03912.07
5.4.100.0050.03812.07
5.4.90.0070.03912.07
5.4.80.0090.03612.07
5.4.70.0070.03712.07
5.4.60.0100.03412.07
5.4.50.0080.03812.07
5.4.40.0110.03212.05
5.4.30.0060.03712.05
5.4.20.0120.03212.05
5.4.10.0070.03612.05
5.4.00.0090.03511.54
5.3.290.0070.04212.80
5.3.280.0080.04512.73
5.3.270.0080.04312.75
5.3.260.0060.04212.74
5.3.250.0070.04012.74
5.3.240.0070.03912.74
5.3.230.0080.03812.73
5.3.220.0050.04112.70
5.3.210.0120.03612.70
5.3.200.0080.03712.70
5.3.190.0070.04012.70
5.3.180.0070.04112.70
5.3.170.0080.03712.70
5.3.160.0060.04112.70
5.3.150.0040.04312.70
5.3.140.0100.03612.69
5.3.130.0080.04112.68
5.3.120.0120.03712.68
5.3.110.0050.04412.69
5.3.100.0050.04312.17
5.3.90.0100.03712.15
5.3.80.0080.03712.15
5.3.70.0050.04012.15
5.3.60.0080.04412.13
5.3.50.0080.03612.08
5.3.40.0110.03612.08
5.3.30.0030.04312.04
5.3.20.0080.03711.82
5.3.10.0050.04011.78
5.3.00.0120.04911.77
5.2.170.0030.0339.21
5.2.160.0050.0299.21
5.2.150.0070.0289.22
5.2.140.0010.0349.21
5.2.130.0040.0299.17
5.2.120.0070.0259.18
5.2.110.0080.0259.18
5.2.100.0060.0289.18
5.2.90.0080.0349.18
5.2.80.0070.0409.17
5.2.70.0050.0349.17
5.2.60.0070.0279.13
5.2.50.0050.0309.09
5.2.40.0050.0289.07
5.2.30.0050.0309.05
5.2.20.0060.0289.04
5.2.10.0080.0348.95
5.2.00.0080.0278.81
5.1.60.0050.0258.09
5.1.50.0070.0228.08
5.1.40.0040.0258.07
5.1.30.0020.0288.42
5.1.20.0010.0298.44
5.1.10.0030.0288.16
5.1.00.0030.0278.16
5.0.50.0040.0206.64
5.0.40.0040.0206.50
5.0.30.0030.0326.31
5.0.20.0050.0186.29
5.0.10.0040.0196.26
5.0.00.0030.0316.25
4.4.90.0030.0154.78
4.4.80.0060.0184.75
4.4.70.0030.0154.75
4.4.60.0060.0124.76
4.4.50.0020.0164.77
4.4.40.0000.0284.71
4.4.30.0020.0164.76
4.4.20.0030.0154.84
4.4.10.0020.0164.84
4.4.00.0020.0254.76
4.3.110.0040.0144.67
4.3.100.0030.0144.67
4.3.90.0030.0154.63
4.3.80.0040.0244.58
4.3.70.0040.0134.63
4.3.60.0040.0134.63
4.3.50.0030.0164.63
4.3.40.0040.0234.54
4.3.30.0030.0153.30
4.3.20.0030.0153.28
4.3.10.0010.0163.24
4.3.00.0000.01718.23

preferences:
42.12 ms | 401 KiB | 5 Q