3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strToHex($string) { $hex=''; for ($i=0; $i < strlen($string); $i++) { $hex .= dechex(ord($string[$i])); } return $hex; } function hexToStr($hex) { $string=''; for ($i=0; $i < strlen($hex)-1; $i+=2) { $string .= chr(hexdec($hex[$i].$hex[$i+1])); } return $string; } $test = "ffff:eeee:dddd:cccc:bbbb:aaaa:9999:8888"; $testParts = explode(':', $test); $testHex = array(); foreach($testParts as $testPart){ array_push($testHex, strToHex($testPart)); } $packed = pack('nvc*', $testHex[0], $testHex[1], $testHex[2], $testHex[3], $testHex[4], $testHex[5], $testHex[6], $testHex[7]); $unpacked = unpack('nvc*', $packed); $unpackedString = array(); var_dump($testParts); var_dump($testHex); var_dump($packed); var_dump($unpacked); foreach($unpacked as $unpack){ array_push($unpackedString, $unpack); } echo implode(':', $unpackedString); ?>

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)
8.3.70.0160.00316.75
8.3.60.0170.00318.43
8.3.50.0140.00421.27
8.3.40.0070.01118.79
8.3.30.0000.01320.25
8.3.20.0080.00020.34
8.3.10.0050.00321.10
8.3.00.0040.00422.47
8.2.180.0040.01116.88
8.2.170.0140.00722.96
8.2.160.0100.00722.11
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00320.88
8.2.110.0090.00019.21
8.2.100.0140.00017.78
8.2.90.0060.00319.20
8.2.80.0040.00418.05
8.2.70.0090.00017.63
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0040.00418.28
8.2.30.0000.00719.48
8.2.20.0040.00417.75
8.2.10.0040.00417.66
8.2.00.0000.00717.89
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00620.80
8.1.230.0120.00020.98
8.1.220.0040.00418.77
8.1.210.0040.00419.02
8.1.200.0030.00617.23
8.1.190.0000.00717.54
8.1.180.0060.00618.10
8.1.170.0000.00818.59
8.1.160.0040.00418.84
8.1.150.0030.00518.64
8.1.140.0030.00517.40
8.1.130.0040.00417.86
8.1.120.0000.00717.52
8.1.110.0000.00817.39
8.1.100.0000.00817.49
8.1.90.0040.00417.41
8.1.80.0000.00717.45
8.1.70.0030.00317.50
8.1.60.0060.00317.52
8.1.50.0000.00817.62
8.1.40.0040.00417.52
8.1.30.0000.00817.60
8.1.20.0040.00417.71
8.1.10.0000.00917.58
8.1.00.0040.00417.43
8.0.300.0000.00719.79
8.0.290.0000.00817.18
8.0.280.0000.01018.36
8.0.270.0040.00417.36
8.0.260.0000.00716.86
8.0.250.0070.00016.93
8.0.240.0040.00416.90
8.0.230.0070.00016.98
8.0.220.0000.00716.88
8.0.210.0030.00316.89
8.0.200.0000.00616.98
8.0.190.0040.00416.99
8.0.180.0030.00516.95
8.0.170.0000.00716.85
8.0.160.0070.00016.85
8.0.150.0070.00016.84
8.0.140.0000.00716.89
8.0.130.0060.00013.43
8.0.120.0030.00616.79
8.0.110.0040.00416.81
8.0.100.0000.00716.95
8.0.90.0070.00016.71
8.0.80.0090.00916.92
8.0.70.0000.00716.88
8.0.60.0080.00016.92
8.0.50.0050.00216.91
8.0.30.0120.01217.22
8.0.20.0120.01517.40
8.0.10.0040.00416.89
8.0.00.0090.01616.91
7.4.330.0060.00015.10
7.4.320.0070.00016.46
7.4.300.0050.00216.63
7.4.290.0000.00716.54
7.4.280.0060.00216.48
7.4.270.0000.00716.55
7.4.260.0000.00513.31
7.4.250.0030.00616.50
7.4.240.0040.00316.50
7.4.230.0000.00716.57
7.4.220.0070.01016.67
7.4.210.0080.00916.63
7.4.200.0050.00216.37
7.4.190.0030.00316.60
7.4.160.0120.00416.57
7.4.150.0120.00617.40
7.4.140.0120.00617.86
7.4.130.0140.00616.52
7.4.120.0080.00916.54
7.4.110.0120.00616.56
7.4.100.0120.00616.63
7.4.90.0060.01316.61
7.4.80.0160.00919.39
7.4.70.0140.00416.32
7.4.60.0120.00616.45
7.4.50.0030.00616.73
7.4.40.0070.01122.77
7.4.30.0100.01316.56
7.4.00.0090.00715.16
7.3.330.0050.00013.26
7.3.320.0030.00313.39
7.3.310.0030.00316.39
7.3.300.0000.00716.43
7.3.290.0070.00716.35
7.3.280.0090.01016.44
7.3.270.0100.01017.40
7.3.260.0120.00818.24
7.3.250.0060.01116.43
7.3.240.0130.00716.43
7.3.230.0140.00316.43
7.3.210.0110.00616.70
7.3.200.0180.00019.39
7.3.190.0110.00716.46
7.3.180.0100.00716.34
7.3.170.0070.01016.43
7.3.160.0100.00616.58
7.3.120.0090.00914.97
7.3.110.0100.00714.67
7.3.100.0070.01014.87
7.3.90.0090.00314.57
7.3.80.0090.00014.96
7.3.70.0000.01014.79
7.3.60.0090.00614.64
7.3.50.0030.00914.94
7.3.40.0100.00714.89
7.3.30.0100.00714.99
7.3.20.0060.00616.51
7.3.10.0050.00516.48
7.3.00.0050.00816.63
7.2.330.0090.00916.50
7.2.320.0090.01016.77
7.2.310.0030.01416.44
7.2.300.0070.01016.47
7.2.290.0100.00716.77
7.2.250.0070.01315.13
7.2.240.0100.01014.95
7.2.230.0080.00815.20
7.2.220.0040.00715.02
7.2.210.0040.01114.86
7.2.200.0000.01015.09
7.2.190.0040.00814.86
7.2.180.0110.00415.05
7.2.170.0030.01315.21
7.2.130.0080.00416.82
7.2.120.0030.01016.79
7.2.110.0120.00816.48
7.2.100.0080.00416.56
7.2.90.0080.00816.89
7.2.80.0030.01416.80
7.2.70.0070.00717.08
7.2.60.0060.00616.84
7.2.50.0110.01316.82
7.2.40.0120.00917.05
7.2.30.0160.01016.51
7.2.20.0130.00316.81
7.2.10.0090.00616.85
7.2.00.0070.00918.17
7.1.330.0030.01015.83
7.1.320.0100.00615.72
7.1.310.0080.00815.87
7.1.300.0030.00615.85
7.1.290.0040.01115.76
7.1.280.0040.01115.75
7.1.270.0060.00915.52
7.1.260.0050.00515.88
7.1.250.0000.01115.63
7.1.200.0100.00315.86
7.1.100.0100.00017.81
7.1.70.0040.00417.15
7.1.60.0120.01219.17
7.1.50.0140.01016.85
7.1.00.0070.07322.37
7.0.200.0000.00816.55
7.0.140.0070.06722.08
7.0.70.3900.03719.84
7.0.60.0100.08020.07
7.0.50.0130.07717.82
7.0.40.0000.07020.23
7.0.30.0530.05020.08
7.0.20.0300.04020.15
7.0.10.0270.08720.16
7.0.00.0100.08020.41
5.6.280.0070.07021.09
5.6.210.0030.05320.77
5.6.200.0070.08018.29
5.6.190.0100.03720.32
5.6.180.0070.08720.44
5.6.170.0500.07320.49
5.6.160.0000.09320.54
5.6.150.0070.06718.13
5.6.140.0030.04018.12
5.6.130.0000.05018.12
5.6.120.0070.05020.95
5.6.110.0070.08021.12
5.6.100.0100.04021.02
5.6.90.0070.05320.98
5.6.80.0100.03720.54
5.6.70.0270.06720.41
5.5.350.0070.06720.41
5.5.340.0130.07718.02
5.5.330.0030.09020.43
5.5.320.0030.08320.41
5.5.310.0330.07320.21
5.5.300.0100.07017.95
5.5.290.0070.05317.97
5.5.280.0100.06320.95
5.5.270.0130.07720.69
5.5.260.0200.07320.86
5.5.250.0070.08720.67
5.5.240.0030.04020.30
5.4.450.0230.03719.20
5.4.440.1830.03719.27
5.4.430.1830.03319.27
5.4.420.1930.03719.54
5.4.410.1800.04019.25
5.4.400.2030.04019.06
5.4.390.1930.04719.16
5.4.380.1630.03719.07
5.4.370.1470.04019.31
5.4.360.1800.03319.22
5.4.350.0000.05019.27
5.4.340.0030.03718.99
5.4.320.0900.03019.19
5.4.310.0730.03319.23
5.4.300.0000.04019.14
5.4.290.0000.04019.13
5.4.280.1130.03719.14
5.4.270.1530.03719.08
5.4.260.1730.04019.16
5.4.250.1730.03718.86
5.4.240.1730.04019.30
5.4.230.1830.03318.98
5.4.220.1730.04319.06
5.4.210.1730.03718.93
5.4.200.2200.04319.30
5.4.190.1930.03318.98
5.4.180.1830.03018.93
5.4.170.0900.04019.15
5.4.160.0130.02719.04
5.4.150.0070.03319.22
5.4.140.1300.03016.39
5.4.130.1870.03316.71
5.4.120.1700.03716.33
5.4.110.1670.04016.59
5.4.100.2100.04016.46
5.4.90.1770.04016.64
5.4.80.1970.03716.50
5.4.70.2030.03316.58
5.4.60.2000.04316.43
5.4.50.1870.04016.42
5.4.40.2070.04716.51
5.4.30.0170.06316.34
5.4.20.0170.04316.41
5.4.10.0230.06316.50
5.4.00.0200.06315.95
5.3.290.0270.07314.75
5.3.280.0270.07014.59
5.3.270.0270.04014.63
5.3.260.0370.07014.54
5.3.250.0170.04714.59
5.3.240.0230.07014.52
5.3.230.0330.03014.52
5.3.220.0270.06714.73
5.3.210.0300.06014.63
5.3.200.0200.07314.71
5.3.190.0170.05014.50
5.3.180.0170.05314.55
5.3.170.0230.06714.69
5.3.160.0200.03314.49
5.3.150.0100.05314.65
5.3.140.0230.06014.50
5.3.130.0200.07714.53
5.3.120.0200.05314.46
5.3.110.0230.04314.47
5.3.100.0170.07014.02
5.3.90.0200.04714.05
5.3.80.0270.06714.01
5.3.70.0170.07714.25
5.3.60.0100.05314.07
5.3.50.0230.03713.98
5.3.40.0230.03014.02
5.3.30.0200.05713.84
5.3.20.0130.04313.62
5.3.10.0200.03013.58
5.3.00.0230.04013.57
5.2.170.0200.02311.08
5.2.160.0200.05711.07
5.2.150.0200.03711.19
5.2.140.0130.03711.11
5.2.130.0230.05711.05
5.2.120.0200.04011.05
5.2.110.0100.03711.20
5.2.100.0130.03311.08
5.2.90.0170.04711.04
5.2.80.0170.03311.35
5.2.70.0200.03311.02
5.2.60.0200.03711.29
5.2.50.0170.02710.96
5.2.40.0100.03011.14
5.2.30.0100.05310.90
5.2.20.0100.03710.89
5.2.10.0100.03710.82
5.2.00.0130.05310.71
5.1.60.0130.0409.94
5.1.50.0230.0379.94
5.1.40.0130.0309.93
5.1.30.0130.02710.30
5.1.20.0100.03710.29
5.1.10.0100.02710.32
5.1.00.0130.02310.01
5.0.50.0100.0438.46
5.0.40.0100.0278.33
5.0.30.0130.0538.37
5.0.20.0070.0208.23
5.0.10.0130.0378.34
5.0.00.0030.0438.23
4.4.90.0070.0178.23
4.4.80.0030.0208.23
4.4.70.0070.0238.23
4.4.60.0030.0238.23
4.4.50.0030.0208.23
4.4.40.0070.0408.23
4.4.30.0070.0378.23
4.4.20.0030.0308.23
4.4.10.0130.0208.23
4.4.00.0070.0538.23
4.3.110.0030.0208.23
4.3.100.0030.0238.23
4.3.90.0030.0278.23
4.3.80.0030.0308.23
4.3.70.0030.0208.23
4.3.60.0100.0108.23
4.3.50.0070.0338.23
4.3.40.0070.0308.23
4.3.30.0030.0178.23
4.3.20.0000.0208.23
4.3.10.0030.0138.23
4.3.00.0030.0338.23

preferences:
50.51 ms | 401 KiB | 5 Q