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 sizeof($uuid) . PHP_EOL; echo $packedUuid . PHP_EOL; echo sizeof($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.4.10.0070.01014.83
7.4.00.0100.00814.87
7.3.130.0070.01014.79
7.3.120.0140.00414.97
7.3.110.0100.00814.79
7.3.100.0070.00714.98
7.3.90.0050.01114.93
7.3.80.0060.01014.91
7.3.70.0030.01014.70
7.3.60.0030.00914.94
7.3.50.0050.01014.64
7.3.40.0040.01114.79
7.3.30.0070.00714.86
7.3.20.0120.00216.58
7.3.10.0090.00616.54
7.3.00.0050.01016.63
7.2.260.0040.01114.96
7.2.250.0000.01715.21
7.2.240.0050.01315.21
7.2.230.0040.00714.95
7.2.220.0070.00715.09
7.2.210.0100.00615.06
7.2.200.0050.00915.06
7.2.190.0070.00915.04
7.2.180.0070.00915.16
7.2.170.0090.00514.93
7.2.160.0030.00614.96
7.2.150.0040.01117.04
7.2.140.0030.00616.96
7.2.130.0070.00716.59
7.2.120.0000.01416.75
7.2.110.0100.00316.69
7.2.100.0110.00316.72
7.2.90.0100.00716.95
7.2.80.0070.01116.95
7.2.70.0070.00716.80
7.2.60.0100.00317.00
7.2.50.0030.01316.89
7.2.40.0040.00717.07
7.2.30.0090.00316.56
7.2.20.0030.01016.86
7.2.10.0100.00616.89
7.2.00.0000.01518.22
7.1.330.0050.01115.77
7.1.320.0080.00515.80
7.1.310.0050.00815.73
7.1.300.0030.00915.66
7.1.290.0070.00815.70
7.1.280.0080.00415.60
7.1.270.0030.01015.65
7.1.260.0040.00915.73
7.1.250.0000.01315.70
7.1.240.0070.01015.98
7.1.230.0090.00315.56
7.1.220.0060.00615.73
7.1.210.0070.00715.80
7.1.200.0090.00615.62
7.1.190.0040.00815.48
7.1.180.0030.00915.90
7.1.170.0040.01115.65
7.1.160.0110.00415.73
7.1.150.0040.01115.85
7.1.140.0070.00715.73
7.1.130.0070.00315.83
7.1.120.0110.00315.97
7.1.110.0060.00915.86
7.1.100.0100.00715.60
7.1.90.0030.00615.86
7.1.80.0060.00915.91
7.1.70.0020.00616.41
7.1.60.0080.01217.66
7.1.50.0080.00816.29
7.1.40.0070.00415.76
7.1.30.0040.00715.66
7.1.20.0090.00615.74
7.1.10.0050.00315.80
7.1.00.0050.04119.05
7.0.330.0090.00615.37
7.0.320.0000.01115.18
7.0.310.0080.00815.32
7.0.300.0030.01015.25
7.0.290.0080.00015.41
7.0.280.0070.00715.39
7.0.270.0040.00715.30
7.0.260.0060.01215.38
7.0.250.0060.00615.42
7.0.240.0090.00315.22
7.0.230.0060.00615.26
7.0.220.0080.00815.66
7.0.210.0070.00715.16
7.0.200.0070.00315.00
7.0.190.0030.00615.56
7.0.180.0030.00915.59
7.0.170.0030.00615.58
7.0.160.0060.00915.29
7.0.150.0000.01215.52
7.0.140.0030.04118.69
7.0.130.0040.01015.57
7.0.120.0070.00715.36
7.0.110.0040.01115.49
7.0.100.0110.00415.23
7.0.90.0080.00815.47
7.0.80.0040.01115.23
7.0.70.0000.01215.22
7.0.60.0050.03017.60
7.0.50.0050.02216.61
7.0.40.0030.02816.73
7.0.30.0180.04016.77
7.0.20.0170.02316.80
7.0.10.0050.02516.84
7.0.00.0070.03816.83
5.6.400.0030.00613.98
5.6.390.0080.00614.34
5.6.380.0000.01513.97
5.6.370.0030.01414.23
5.6.360.0100.00314.22
5.6.350.0070.00714.43
5.6.340.0060.00914.17
5.6.330.0080.00414.37
5.6.320.0000.01414.57
5.6.310.0030.01314.49
5.6.300.0070.00714.40
5.6.290.0040.00714.20
5.6.280.0050.04017.44
5.6.270.0070.01114.03
5.6.260.0030.01314.35
5.6.250.0040.01214.02
5.6.240.0090.00314.41
5.6.230.0070.00714.08
5.6.220.0040.01114.44
5.6.210.0020.03017.42
5.6.200.0080.03516.22
5.6.190.0080.02717.33
5.6.180.0220.01817.21
5.6.170.0200.03717.25
5.6.160.0100.03517.45
5.6.150.0100.02416.21
5.6.140.0070.04316.25
5.6.130.0100.01716.09
5.6.120.0030.04817.48
5.6.110.0020.03017.67
5.6.100.0050.02617.52
5.6.90.0050.04817.44
5.6.80.0100.04017.30
5.6.70.0090.00414.26
5.6.60.0000.01814.21
5.6.50.0090.00614.10
5.6.40.0070.00714.03
5.6.30.0060.00614.40
5.6.20.0030.01214.29
5.6.10.0070.00314.14
5.6.00.0060.00614.28
5.5.380.0040.00414.45
5.5.370.0070.00714.45
5.5.360.0070.00714.34
5.5.350.0060.03617.27
5.5.340.0070.02215.90
5.5.330.0080.02316.99
5.5.320.0140.04717.03
5.5.310.0220.02217.19
5.5.300.0050.02616.01
5.5.290.0090.03715.93
5.5.280.0030.02917.53
5.5.270.0030.03617.46
5.5.260.0120.04217.60
5.5.250.0140.03517.16
5.5.240.0020.04317.14
5.5.230.0030.00614.19
5.5.220.0060.00914.24
5.5.210.0030.01013.93
5.5.200.0040.00414.28
5.5.190.0030.01214.08
5.5.180.0080.00814.18
5.5.170.0070.00414.03
5.5.160.0040.01114.14
5.5.150.0060.00614.27
5.5.140.0070.00713.98
5.5.130.0060.00914.22
5.5.120.0000.00814.41
5.5.110.0040.01114.23
5.5.100.0030.00913.76
5.5.90.0000.00814.21
5.5.80.0090.00013.97
5.5.70.0100.00714.06
5.5.60.0030.00914.34
5.5.50.0030.00614.17
5.5.40.0080.00814.20
5.5.30.0070.00714.33
5.5.20.0070.00713.93
5.5.10.0040.00414.30
5.5.00.0040.00813.78
5.4.450.0300.03816.11
5.4.440.0400.03716.10
5.4.430.0050.03216.18
5.4.420.0070.03316.20
5.4.410.0000.03615.89
5.4.400.0070.03215.82
5.4.390.0100.03015.84
5.4.380.0080.02715.73
5.4.370.0120.02815.80
5.4.360.0100.02715.75
5.4.350.0040.03112.44
5.4.340.0070.02512.44
5.4.330.0030.00312.90
5.4.320.0080.02612.68
5.4.310.0060.02112.68
5.4.300.0060.02212.68
5.4.290.0030.02312.68
5.4.280.0070.02212.63
5.4.270.0030.02412.63
5.4.260.0070.02012.63
5.4.250.0040.02112.63
5.4.240.0030.03615.94
5.4.230.0050.02715.77
5.4.220.0100.02515.95
5.4.210.0120.03615.84
5.4.200.0090.03215.86
5.4.190.0050.03215.86
5.4.180.0070.02815.87
5.4.170.0070.02515.76
5.4.160.0030.03015.81
5.4.150.0110.03315.79
5.4.140.0030.03014.57
5.4.130.0080.02314.57
5.4.120.0090.02914.57
5.4.110.0040.03014.57
5.4.100.0070.02814.63
5.4.90.0060.02614.67
5.4.80.0110.02314.61
5.4.70.0080.03014.64
5.4.60.0050.03114.56
5.4.50.0020.03114.58
5.4.40.0050.03714.56
5.4.30.0000.03714.57
5.4.20.0030.03214.49
5.4.10.0040.03014.56
5.4.00.0120.02514.34
5.3.290.0060.02412.85
5.3.280.0110.03313.74
5.3.270.0080.02813.83
5.3.260.0110.02913.76
5.3.250.0100.02713.75
5.3.240.0120.02313.76
5.3.230.0080.03913.69
5.3.220.0120.03313.69
5.3.210.0080.02913.79
5.3.200.0120.03713.66
5.3.190.0030.03113.70
5.3.180.0120.03713.63
5.3.170.0070.03013.73
5.3.160.0080.02913.58
5.3.150.0080.02913.78
5.3.140.0020.03313.66
5.3.130.0120.02613.73
5.3.120.0120.03113.73
5.3.110.0100.03813.74
5.3.100.0060.03113.49
5.3.90.0090.02613.46
5.3.80.0050.02913.47
5.3.70.0110.03113.35
5.3.60.0040.03113.37
5.3.50.0090.02613.31
5.3.40.0050.03113.45
5.3.30.0060.02913.35
5.3.20.0090.02713.32
5.3.10.0110.03213.16
5.3.00.0140.02213.24
5.2.170.0030.04311.23
5.2.160.0070.04711.15
5.2.150.0030.04311.30
5.2.140.0070.04011.29
5.2.130.0070.04010.95
5.2.120.0100.03310.86
5.2.110.0130.03311.21
5.2.100.0070.03710.99
5.2.90.0100.03711.07
5.2.80.0100.03311.10
5.2.70.0000.06311.11
5.2.60.0070.04311.05
5.2.50.0030.04711.02
5.2.40.0070.04010.83
5.2.30.0030.06010.98
5.2.20.0130.04710.97
5.2.10.0030.03710.93
5.2.00.0000.04710.79
5.1.60.0070.0439.83
5.1.50.0030.03710.05
5.1.40.0000.03710.04
5.1.30.0030.04310.23
5.1.20.0000.04010.17
5.1.10.0070.03310.10
5.1.00.0030.05010.30
5.0.50.0000.0308.50
5.0.40.0030.0238.38
5.0.30.0030.0408.06
5.0.20.0070.0278.29
5.0.10.0070.0278.17
5.0.00.0070.0378.16
4.4.90.0000.0235.81
4.4.80.0100.0135.86
4.4.70.0000.0305.78
4.4.60.0000.0235.86
4.4.50.0030.0205.83
4.4.40.0070.0305.89
4.4.30.0000.0335.89
4.4.20.0030.0205.89
4.4.10.0070.0235.89
4.4.00.0030.0305.89
4.3.110.0030.0235.89
4.3.100.0070.0235.89
4.3.90.0030.0175.89
4.3.80.0000.0335.89
4.3.70.0000.0205.89
4.3.60.0100.0135.89
4.3.50.0070.0175.89
4.3.40.0030.0305.89
4.3.30.0070.0275.89
4.3.20.0030.0205.89
4.3.10.0070.0235.89
4.3.00.0130.0236.59

preferences:
41.17 ms | 401 KiB | 5 Q