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(10); } if (count(array_unique($uuids)) != count($uuids)) { echo 'DUPLICATED'; } 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.0090.00916.80
7.3.00.0000.01516.55
7.2.130.0080.00316.93
7.2.120.0040.01116.66
7.2.110.0030.01317.07
7.2.100.0080.00416.96
7.2.90.0090.00616.81
7.2.80.0110.00716.92
7.2.70.0060.00616.65
7.2.60.0040.01117.04
7.2.50.0140.00016.95
7.2.40.0060.01016.73
7.2.30.0060.00916.96
7.2.20.0100.00316.61
7.2.10.0110.00416.71
7.2.00.0040.00618.16
7.1.250.0070.00315.54
7.1.70.0030.00617.16
7.1.60.0030.01217.22
7.1.50.0040.01816.99
7.1.00.0070.07722.42
7.0.200.0060.00616.82
7.0.140.0030.07721.91
7.0.60.0170.07320.03
7.0.50.0070.05317.90
7.0.40.0030.05320.26
7.0.30.0270.05720.19
7.0.20.0230.03720.08
7.0.10.0200.04320.24
7.0.00.0030.05720.25
5.6.280.0130.06720.81
5.6.210.0130.08320.73
5.6.200.0170.04018.16
5.6.190.0100.05720.55
5.6.180.0230.05320.54
5.6.170.0270.06720.48
5.6.160.0030.07720.50
5.6.150.0100.07718.29
5.6.140.0070.05718.21
5.6.130.0030.04718.16
5.6.120.0000.09321.13
5.6.110.0100.08321.16
5.6.100.0270.07321.14
5.6.90.0070.09021.07
5.6.80.0130.07720.41
5.6.70.4470.04020.47
5.5.350.0070.08720.44
5.5.340.0030.05317.98
5.5.330.0100.08320.40
5.5.320.0430.04020.30
5.5.310.0270.08020.33
5.5.300.0070.08318.06
5.5.290.0100.07017.97
5.5.280.0100.08020.69
5.5.270.0200.05720.80
5.5.260.0070.08020.79
5.5.250.0130.07720.82
5.5.240.0170.07020.20
5.4.450.0400.06019.20
5.4.440.0070.07719.43
5.4.430.0130.08319.56
5.4.420.0270.07719.64
5.4.410.0300.07019.43
5.4.400.0270.04719.09
5.4.390.2430.04019.09
5.4.380.0400.06019.22
5.4.370.0270.05718.95
5.4.360.0430.05019.32
5.4.350.0300.03718.84
5.4.340.0130.05319.20
5.4.320.0090.03612.56
5.4.310.0110.03712.56
5.4.300.0050.04112.57
5.4.290.0080.04012.56
5.4.280.0050.04012.45
5.4.270.0090.03812.45
5.4.260.0030.04212.46
5.4.250.0070.04012.45
5.4.240.0110.03612.46
5.4.230.0050.04312.45
5.4.220.0070.04312.45
5.4.210.0100.04312.45
5.4.200.0120.03712.45
5.4.190.0120.04312.45
5.4.180.0100.03712.45
5.4.170.0080.03912.45
5.4.160.0070.03912.45
5.4.150.0090.03812.45
5.4.140.0060.04112.13
5.4.130.0150.04512.12
5.4.120.0100.05212.07
5.4.110.0130.06412.07
5.4.100.0150.04312.07
5.4.90.0100.05212.07
5.4.80.0100.05112.07
5.4.70.0130.04712.07
5.4.60.0120.04812.07
5.4.50.0070.04712.07
5.4.40.0110.03812.05
5.4.30.0080.04912.05
5.4.20.0080.04412.05
5.4.10.0140.05012.05
5.4.00.0130.04911.54

preferences:
35.77 ms | 401 KiB | 5 Q