3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uuid = sprintf('%04x%04x%04x%04x%04x%04x%04x%04x', // 32 bits for "time_low" mt_rand(0, 0xffff), mt_rand(0, 0xffff), // 16 bits for "time_mid" mt_rand(0, 0xffff), // 16 bits for "time_hi_and_version", // four most significant bits holds version number 4 mt_rand(0, 0x0fff) | 0x4000, // 16 bits, 8 bits for "clk_seq_hi_res", // 8 bits for "clk_seq_low", // two most significant bits holds zero and one // for variant DCE1.1 mt_rand(0, 0x3fff) | 0x8000, // 48 bits for "node" mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) ); $packedUuid = pack('H*', $uuid); echo $uuid . PHP_EOL; echo $packedUuid . PHP_EOL;

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.1.70.0050.01017.04
7.1.60.0100.00017.25
7.1.50.0130.01616.71
7.1.00.0000.03722.51
7.0.200.0000.01716.97
7.0.140.0030.07722.18
7.0.70.4870.04319.98
7.0.60.0130.07319.98
7.0.50.0030.08717.85
7.0.40.0130.08020.19
7.0.30.0500.07320.02
7.0.20.0330.06320.09
7.0.10.0270.03720.13
7.0.00.0170.06720.16
5.6.280.0030.07021.06
5.6.210.0070.08720.66
5.6.200.0070.07318.11
5.6.190.0030.06320.41
5.6.180.0130.06320.41
5.6.170.0230.04020.51
5.6.160.0030.05020.40
5.6.150.0070.07318.13
5.6.140.0070.04718.07
5.6.130.0000.04318.11
5.6.120.0130.06721.02
5.6.110.0170.05720.98
5.6.100.0100.08020.99
5.6.90.0100.08020.97
5.6.80.0200.06720.40
5.6.70.0130.06720.43
5.5.350.0070.07320.43
5.5.340.0070.08017.98
5.5.330.0130.06720.42
5.5.320.0030.08320.07
5.5.310.0200.08320.41
5.5.300.0200.06317.89
5.5.290.0030.07717.91
5.5.280.0100.06720.76
5.5.270.0030.07720.89
5.5.260.0070.08020.77
5.5.250.0170.07720.65
5.5.240.0130.07720.17
5.4.450.0700.08319.32
5.4.440.1500.09719.52
5.4.430.0970.05319.47
5.4.420.0700.06719.46
5.4.410.0100.07319.51
5.4.400.0670.05719.18
5.4.390.0330.05319.14
5.4.380.0130.08018.54
5.4.370.0230.04018.65
5.4.360.0170.04718.69
5.4.350.0050.03711.98
5.4.340.0050.03511.97
5.4.320.0060.04012.45
5.4.310.0100.03312.45
5.4.300.0070.04212.45
5.4.290.0020.04412.45
5.4.280.0120.04512.35
5.4.270.0100.04212.35
5.4.260.0040.03912.35
5.4.250.0060.04512.35
5.4.240.0130.04718.82
5.4.230.0070.05318.63
5.4.220.0130.07318.79
5.4.210.0030.05318.71
5.4.200.0070.05018.83
5.4.190.0070.05718.95
5.4.180.0100.04718.58
5.4.170.0070.05318.98
5.4.160.0070.05018.80
5.4.150.0130.04718.94
5.4.140.0130.04316.38
5.4.130.0100.05716.43
5.4.120.0170.04716.44
5.4.110.0030.05316.29
5.4.100.0100.04316.10
5.4.90.0100.04716.39
5.4.80.0100.06316.45
5.4.70.0070.04716.12
5.4.60.0130.04316.25
5.4.50.0130.05316.07
5.4.40.0100.04716.23
5.4.30.0100.04716.36
5.4.20.0030.05316.36
5.4.10.0170.04316.30
5.4.00.0030.05015.66
5.3.290.0090.04812.80
5.3.280.0070.05014.29
5.3.270.0100.05014.63
5.3.260.0070.05714.64
5.3.250.0170.04314.60
5.3.240.0070.05014.60
5.3.230.0100.05014.61
5.3.220.0100.05314.61
5.3.210.0070.05014.40
5.3.200.0070.07714.59
5.3.190.0070.05014.58
5.3.180.0100.04714.34
5.3.170.0030.05014.65
5.3.160.0070.05014.26
5.3.150.0070.05014.57
5.3.140.0100.05314.66
5.3.130.0070.05714.64
5.3.120.0100.05014.64
5.3.110.0070.06314.56
5.3.100.0130.04314.15
5.3.90.0070.06314.06
5.3.80.0070.05013.71
5.3.70.0030.05714.02
5.3.60.0030.05714.11
5.3.50.0000.05314.09
5.3.40.0130.04313.96
5.3.30.0200.03313.96
5.3.20.0070.06013.52
5.3.10.0070.04713.69
5.3.00.0100.04313.73
5.2.170.0070.04311.14
5.2.160.0000.06011.06
5.2.150.0030.04010.92
5.2.140.0030.04311.04
5.2.130.0030.06310.93
5.2.120.0030.04011.10
5.2.110.0000.05711.21
5.2.100.0070.03311.11
5.2.90.0030.05011.10
5.2.80.0070.06011.12
5.2.70.0130.05310.99
5.2.60.0100.03711.20
5.2.50.0100.04311.04
5.2.40.0030.04010.93
5.2.30.0130.03011.08
5.2.20.0000.04010.90
5.2.10.0000.05010.86
5.2.00.0070.03710.72
5.1.60.0170.02010.05
5.1.50.0070.03010.23
5.1.40.0000.0379.95
5.1.30.0070.03310.21
5.1.20.0070.04710.19
5.1.10.0070.0339.98
5.1.00.0070.04710.11
5.0.50.0070.0238.69
5.0.40.0030.0238.34
5.0.30.0100.0338.31
5.0.20.0100.0208.18
5.0.10.0070.0308.12
5.0.00.0030.0408.31
4.4.90.0000.0236.95
4.4.80.0070.0176.95
4.4.70.0070.0176.95
4.4.60.0000.0306.95
4.4.50.0030.0206.95
4.4.40.0070.0306.95
4.4.30.0030.0206.95
4.4.20.0030.0306.95
4.4.10.0000.0236.95
4.4.00.0030.0306.95
4.3.110.0030.0206.95
4.3.100.0030.0206.95
4.3.90.0030.0306.95
4.3.80.0030.0306.95
4.3.70.0000.0206.95
4.3.60.0030.0276.95
4.3.50.0070.0176.95
4.3.40.0000.0406.95
4.3.30.0070.0176.95
4.3.20.0000.0236.95
4.3.10.0030.0206.95
4.3.00.0130.0237.38

preferences:
37.13 ms | 401 KiB | 5 Q