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); $unpackedUuid = unpack('H*', $packedUuid); echo $uuid . PHP_EOL; echo strlen($uuid) . PHP_EOL; echo $packedUuid . PHP_EOL; echo strlen($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.2.00.0040.01419.36
7.1.70.0000.00817.19
7.1.60.0140.01019.43
7.1.50.0090.01316.71
7.1.00.0000.03722.33
7.0.200.0180.00415.07
7.0.140.0100.06722.01
7.0.90.0070.04319.99
7.0.80.0130.08719.88
7.0.70.0070.05720.03
7.0.60.0330.07319.89
7.0.50.0500.08720.40
7.0.40.0130.07320.04
7.0.30.0100.08720.07
7.0.20.0130.05020.04
7.0.10.0030.09020.14
7.0.00.0170.07320.12
5.6.230.0030.08720.71
5.6.220.0170.07320.64
5.6.210.0000.05320.46
5.6.200.0030.06721.06
5.6.190.0070.07721.10
5.6.180.0170.07021.01
5.6.170.0230.06321.05
5.6.160.0030.07720.91
5.6.150.0030.04720.95
5.6.140.0070.07021.05
5.6.130.0070.04321.02
5.6.120.0130.07321.01
5.6.110.0100.08021.15
5.6.100.0030.08020.91
5.6.90.0130.07720.98
5.6.80.0130.06720.40
5.6.70.0200.05320.39
5.6.60.0170.07320.48
5.6.50.0200.06320.40
5.6.40.0030.08720.43
5.6.30.0130.07720.36
5.6.20.0170.06720.38
5.6.10.0000.06020.39
5.6.00.0100.07720.47
5.5.370.0000.07320.37
5.5.360.0130.07720.53
5.5.350.0130.07320.39
5.5.340.0130.08020.82
5.5.330.0070.06020.79
5.5.320.0100.07720.76
5.5.310.0030.05020.74
5.5.300.0070.07720.92
5.5.290.0130.08020.83
5.5.280.0200.05720.82
5.5.270.0130.08320.87
5.5.260.0130.06020.90
5.5.250.0070.04720.73
5.5.240.0130.07720.28
5.5.230.0130.07320.15
5.5.220.0070.07720.20
5.5.210.0030.06320.27
5.5.200.0070.07020.18
5.5.190.0130.06720.18
5.5.180.0100.07720.23
5.5.160.0070.06320.22
5.5.150.0100.06320.13
5.5.140.0070.04320.22
5.5.130.0130.07020.23
5.5.120.0070.04720.23
5.5.110.0100.07320.23
5.5.100.0030.08020.11
5.5.90.0170.05020.15
5.5.80.0130.04320.09
5.5.70.0070.04319.93
5.5.60.0070.08320.05
5.5.50.0000.08320.15
5.5.40.0100.08319.95
5.5.30.0070.07020.02
5.5.20.0070.04020.09
5.5.10.0070.08319.91
5.5.00.0070.05320.07
5.4.450.0030.05319.29
5.4.440.0030.08319.45
5.4.430.0100.08019.28
5.4.420.0100.07019.35
5.4.410.0030.04718.98
5.4.400.0030.08019.10
5.4.390.0070.07319.13
5.4.380.0030.07019.02
5.4.370.0030.08018.78
5.4.360.0070.08019.09
5.4.350.0100.06718.79
5.4.340.0030.07018.92
5.4.320.0130.07319.14
5.4.310.0170.07018.83
5.4.300.0200.05319.07
5.4.290.0170.07719.13
5.4.280.0000.07719.09
5.4.270.0070.07318.81
5.4.260.0170.06719.22
5.4.250.0100.06719.14
5.4.240.0100.06319.02
5.4.230.0030.07318.97
5.4.220.0030.07018.97
5.4.210.0100.07319.04
5.4.200.0070.07319.06
5.4.190.0100.06719.11
5.4.180.0100.07019.13
5.4.170.0100.07319.22
5.4.160.0070.04319.08
5.4.150.0100.06019.02
5.4.140.0030.04016.36
5.4.130.0030.07716.08
5.4.120.0030.07316.26
5.4.110.0070.06716.46
5.4.100.0070.06716.30
5.4.90.0130.06316.21
5.4.80.0100.06716.32
5.4.70.0070.07016.42
5.4.60.0030.05016.31
5.4.50.0100.05016.46
5.4.40.0030.07716.50
5.4.30.0030.07316.26
5.4.20.0130.06316.31
5.4.10.0130.07016.38
5.4.00.0000.07015.72
5.3.290.0000.08014.65
5.3.280.0100.09014.41
5.3.270.0100.07314.58
5.3.260.0070.07714.59
5.3.250.0100.07014.60
5.3.240.0170.03014.57
5.3.230.0100.03714.41
5.3.220.0070.06714.55
5.3.210.0100.07314.54
5.3.200.0100.06714.50
5.3.190.0070.07014.54
5.3.180.0130.06014.55
5.3.170.0170.06314.55
5.3.160.0030.04014.40
5.3.150.0130.06714.39
5.3.140.0100.07714.41
5.3.130.0100.07314.37
5.3.120.0030.08014.48
5.3.110.0130.07014.54
5.3.100.0030.05713.95
5.3.90.0000.04713.95
5.3.80.0030.07313.92
5.3.70.0100.07013.84
5.3.60.0030.06713.82
5.3.50.0100.04713.72
5.3.40.0030.07713.95
5.3.30.0070.07313.90
5.3.20.0100.06713.62
5.3.10.0130.06713.60
5.3.00.0070.07313.54
5.2.170.0070.06313.54
5.2.160.0030.06313.54
5.2.150.0100.06013.54
5.2.140.0070.06013.54
5.2.130.0130.04013.54
5.2.120.0030.04713.54
5.2.110.0170.05013.54
5.2.100.0030.06013.54
5.2.90.0000.06713.54
5.2.80.0030.06313.54
5.2.70.0070.04313.54
5.2.60.0100.05313.54
5.2.50.0000.05713.54
5.2.40.0100.03713.54
5.2.30.0100.02713.54
5.2.20.0030.06713.54
5.2.10.0030.06013.54
5.2.00.0100.05713.54
5.1.60.0070.05013.54
5.1.50.0000.03713.54
5.1.40.0100.02713.54
5.1.30.0100.05313.54
5.1.20.0100.05313.54
5.1.10.0070.02313.54
5.1.00.0100.04313.54
5.0.50.0000.03313.54
5.0.40.0000.04713.54
5.0.30.0030.03313.54
5.0.20.0000.02013.54
5.0.10.0070.04013.54
5.0.00.0070.05013.54
4.4.90.0100.02713.54
4.4.80.0000.03713.54
4.4.70.0000.03313.54
4.4.60.0000.03313.54
4.4.50.0000.03313.54
4.4.40.0030.04313.54
4.4.30.0000.03313.54
4.4.20.0030.03013.54
4.4.10.0070.03313.54
4.4.00.0070.04713.54
4.3.110.0030.02713.54
4.3.100.0030.03313.54
4.3.90.0070.03013.54
4.3.80.0070.04713.54
4.3.70.0000.02713.54
4.3.60.0030.02313.54
4.3.50.0030.01313.54
4.3.40.0000.04713.54
4.3.30.0030.02313.54
4.3.20.0000.03013.54
4.3.10.0100.02713.54
4.3.00.0070.02313.54

preferences:
36.96 ms | 401 KiB | 5 Q