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, $testPart); //echo strToHex($testPart) . "<br>\n"; } $packed = pack('nvH*', '0x'.$testParts[0], '0x'.$testParts[1], '0x'.$testParts[2], '0x'.$testParts[3], '0x'.$testParts[4], '0x'.$testParts[5], '0x'.$testParts[6], '0x'.$testParts[7]); $unpacked = unpack('nvH*', $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.60.0070.01318.55
8.3.50.0040.01121.13
8.3.40.0070.00718.97
8.3.30.0030.01720.03
8.3.20.0050.00320.29
8.3.10.0070.00021.84
8.3.00.0040.00422.30
8.2.180.0100.01016.88
8.2.170.0110.00422.96
8.2.160.0140.00022.27
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0030.01026.16
8.2.120.0000.00817.88
8.2.110.0030.00622.08
8.2.100.0040.00817.91
8.2.90.0030.00519.17
8.2.80.0040.00419.26
8.2.70.0040.00417.63
8.2.60.0040.00418.03
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0000.01118.09
8.2.20.0060.00317.71
8.2.10.0080.00017.65
8.2.00.0030.00517.64
8.1.280.0140.00725.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00923.95
8.1.230.0110.00019.01
8.1.220.0050.00317.78
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0080.00017.55
8.1.180.0030.00519.01
8.1.170.0040.00418.61
8.1.160.0000.00721.02
8.1.150.0060.00318.59
8.1.140.0050.00217.50
8.1.130.0000.00717.82
8.1.120.0040.00417.48
8.1.110.0050.00217.34
8.1.100.0080.00017.53
8.1.90.0000.00717.54
8.1.80.0040.00417.41
8.1.70.0030.00317.38
8.1.60.0030.00617.59
8.1.50.0000.00717.52
8.1.40.0040.00417.44
8.1.30.0000.00717.57
8.1.20.0080.00017.66
8.1.10.0040.00417.52
8.1.00.0040.00417.61
8.0.300.0070.00018.77
8.0.290.0000.00717.05
8.0.280.0030.00318.48
8.0.270.0040.00417.16
8.0.260.0000.00716.80
8.0.250.0030.00317.02
8.0.240.0040.00417.07
8.0.230.0030.00317.04
8.0.220.0070.00016.96
8.0.210.0050.00317.04
8.0.200.0000.00717.00
8.0.190.0050.00317.05
8.0.180.0060.00317.03
8.0.170.0030.00517.00
8.0.160.0040.00416.88
8.0.150.0060.00316.86
8.0.140.0040.00316.85
8.0.130.0060.00013.35
8.0.120.0040.00416.93
8.0.110.0040.00416.81
8.0.100.0050.00316.87
8.0.90.0080.00016.85
8.0.80.0000.01616.94
8.0.70.0000.00716.98
8.0.60.0040.00416.94
8.0.50.0020.00516.92
8.0.30.0090.01017.24
8.0.20.0110.00717.40
8.0.10.0040.00417.00
8.0.00.0100.00816.79
7.4.330.0000.00615.00
7.4.320.0030.00316.49
7.4.300.0060.00016.60
7.4.290.0050.00316.63
7.4.280.0080.00016.58
7.4.270.0030.00316.55
7.4.260.0070.00013.34
7.4.250.0040.00416.48
7.4.240.0020.00516.62
7.4.230.0070.00016.71
7.4.220.0130.01316.53
7.4.210.0090.00616.55
7.4.200.0070.00016.61
7.4.190.0070.00016.63
7.4.160.0070.01016.47
7.4.150.0110.00717.40
7.4.140.0080.01517.86
7.4.130.0070.01016.52
7.4.120.0080.01116.62
7.4.110.0190.00516.64
7.4.100.0110.01516.54
7.4.90.0110.00716.39
7.4.80.0100.01319.39
7.4.70.0100.00616.53
7.4.60.0150.00316.28
7.4.50.0060.00316.11
7.4.40.0070.00722.77
7.4.30.0110.00716.53
7.4.00.0090.00314.91
7.3.330.0030.00313.32
7.3.320.0000.00513.47
7.3.310.0070.00016.44
7.3.300.0070.00016.42
7.3.290.0150.00616.30
7.3.280.0080.00816.40
7.3.270.0060.01117.40
7.3.260.0030.01516.60
7.3.250.0060.01316.50
7.3.240.0100.00716.51
7.3.230.0070.01716.44
7.3.210.0130.00416.65
7.3.200.0150.00319.39
7.3.190.0040.01516.45
7.3.180.0030.01216.50
7.3.170.0030.01316.53
7.3.160.0120.00916.46
7.3.120.0090.00314.90
7.2.330.0230.00316.79
7.2.320.0060.01216.65
7.2.310.0030.01516.76
7.2.300.0170.00016.63
7.2.290.0110.00716.55
7.2.80.0040.00816.73
7.2.00.0040.01219.15
7.1.200.0030.01215.83
7.1.100.0060.00318.04
7.1.70.0000.00817.35
7.1.60.0110.01419.32
7.1.50.0030.01916.63
7.1.00.0070.06022.46
7.0.200.0210.00714.80
7.0.140.0000.08021.99
7.0.100.0030.06320.02
7.0.90.0200.05319.95
7.0.80.0070.08019.87
7.0.70.0130.07020.00
7.0.60.0070.06020.08
7.0.50.0070.06320.42
7.0.40.0030.05720.14
7.0.30.0100.04720.09
7.0.20.0100.07320.14
7.0.10.0100.08020.12
7.0.00.0070.07319.95
5.6.280.0100.06720.93
5.6.250.0200.08020.73
5.6.240.0000.07720.67
5.6.230.0030.08320.51
5.6.220.0070.08720.56
5.6.210.0100.08020.70
5.6.200.0100.05321.13
5.6.190.0100.08321.06
5.6.180.0070.07020.95
5.6.170.0100.07720.96
5.6.160.0170.07021.04
5.6.150.0070.07020.95
5.6.140.0130.07721.03
5.6.130.0070.09721.04
5.6.120.0100.08321.14
5.6.110.0100.04721.11
5.6.100.0070.04721.11
5.6.90.0230.07321.09
5.6.80.0070.07320.36
5.6.70.0200.07020.35
5.6.60.0030.05020.49
5.6.50.0130.07020.51
5.6.40.0170.03720.48
5.6.30.0100.07020.33
5.6.20.0070.08020.38
5.6.10.0070.07320.38
5.6.00.0030.06320.37
5.5.380.0170.04020.51
5.5.370.0070.08020.46
5.5.360.0200.06720.50
5.5.350.0100.07720.41
5.5.340.0070.04320.88
5.5.330.0130.04720.88
5.5.320.0100.08020.81
5.5.310.0000.04720.91
5.5.300.0070.04720.72
5.5.290.0100.07720.82
5.5.280.0100.07720.81
5.5.270.0100.04320.88
5.5.260.0130.07020.73
5.5.250.0130.07720.56
5.5.240.0130.07320.15
5.5.230.0170.06720.15
5.5.220.0070.07720.16
5.5.210.0170.06720.16
5.5.200.0130.07320.28
5.5.190.0030.07720.28
5.5.180.0070.05020.00
5.5.160.0170.06320.27
5.5.150.0100.07720.23
5.5.140.0170.07020.00
5.5.130.0070.06020.14
5.5.120.0130.04720.19
5.5.110.0130.07020.23
5.5.100.0170.07020.11
5.5.90.0030.07020.09
5.5.80.0170.06720.11
5.5.70.0100.06320.11
5.5.60.0070.07020.09
5.5.50.0200.04320.04
5.5.40.0100.06720.07
5.5.30.0070.06020.16
5.5.20.0100.04720.06
5.5.10.0030.04020.09
5.5.00.0070.05320.04
5.4.450.0100.05719.46
5.4.440.0130.08019.46
5.4.430.0170.07019.54
5.4.420.0100.06719.46
5.4.410.0070.07019.25
5.4.400.0100.04319.18
5.4.390.0030.06719.00
5.4.380.0100.06018.95
5.4.370.0070.08019.12
5.4.360.0070.04319.04
5.4.350.0030.08019.13
5.4.340.0100.06719.10
5.4.320.0070.04719.21
5.4.310.0130.05719.13
5.4.300.0100.07319.20
5.4.290.0030.04719.13
5.4.280.0070.04319.03
5.4.270.0000.05018.95
5.4.260.0070.04319.13
5.4.250.0070.04319.02
5.4.240.0070.04319.22
5.4.230.0100.06319.04
5.4.220.0130.07319.13
5.4.210.0030.04718.99
5.4.200.0030.07718.86
5.4.190.0000.05319.01
5.4.180.0070.04719.01
5.4.170.0100.07719.04
5.4.160.0030.05319.12
5.4.150.0130.06719.11
5.4.140.0100.06716.48
5.4.130.0100.05716.50
5.4.120.0070.06316.37
5.4.110.0100.06016.52
5.4.100.0070.06016.48
5.4.90.0030.06316.57
5.4.80.0170.05716.47
5.4.70.0070.06716.55
5.4.60.0030.06016.40
5.4.50.0070.04316.41
5.4.40.0070.06316.42
5.4.30.0070.07016.30
5.4.20.0070.04016.24
5.4.10.0030.05016.29
5.4.00.0030.06315.86
5.3.290.0070.07314.65
5.3.280.0070.06714.66
5.3.270.0100.07014.57
5.3.260.0100.07314.63
5.3.250.0200.06014.60
5.3.240.0070.04314.76
5.3.230.0170.05314.68
5.3.220.0000.05314.62
5.3.210.0030.05714.69
5.3.200.0200.05014.51
5.3.190.0030.06714.55
5.3.180.0030.04314.70
5.3.170.0030.04714.55
5.3.160.0070.06314.64
5.3.150.0100.03314.59
5.3.140.0000.05014.66
5.3.130.0070.05714.68
5.3.120.0100.06714.52
5.3.110.0030.06314.71
5.3.100.0100.08014.05
5.3.90.0030.06314.17
5.3.80.0070.07714.14
5.3.70.0100.07013.94
5.3.60.0070.07714.12
5.3.50.0030.04313.87
5.3.40.0100.06014.06
5.3.30.0030.03713.91
5.3.20.0030.05713.75
5.3.10.0070.07013.70
5.3.00.0070.06013.55
5.2.170.0000.04011.17
5.2.160.0030.05011.17
5.2.150.0030.03711.17
5.2.140.0030.06711.25
5.2.130.0030.03311.12
5.2.120.0100.05311.02
5.2.110.0030.06011.03
5.2.100.0130.05011.14
5.2.90.0070.04011.13
5.2.80.0100.05311.21
5.2.70.0100.05311.04
5.2.60.0030.05710.96
5.2.50.0070.05311.02
5.2.40.0000.03711.13
5.2.30.0130.02010.99
5.2.20.0100.04010.99
5.2.10.0100.04011.00
5.2.00.0000.05310.62
5.1.60.0100.04710.07
5.1.50.0070.05010.00
5.1.40.0030.0479.88
5.1.30.0030.05710.42
5.1.20.0000.03310.40
5.1.10.0100.03710.09
5.1.00.0000.0509.92
5.0.50.0030.0338.65
5.0.40.0030.0338.42
5.0.30.0030.0578.35
5.0.20.0000.0408.11
5.0.10.0100.0178.11
5.0.00.0030.0578.19
4.4.90.0070.0208.11
4.4.80.0000.0238.11
4.4.70.0070.0238.11
4.4.60.0030.0338.11
4.4.50.0070.0238.11
4.4.40.0030.0538.11
4.4.30.0000.0378.11
4.4.20.0070.0178.11
4.4.10.0030.0278.11
4.4.00.0030.0578.11
4.3.110.0000.0278.11
4.3.100.0000.0278.11
4.3.90.0070.0308.11
4.3.80.0000.0538.11
4.3.70.0070.0238.11
4.3.60.0030.0208.11
4.3.50.0000.0278.11
4.3.40.0030.0508.11
4.3.30.0000.0308.11
4.3.20.0030.0378.11
4.3.10.0000.0308.11
4.3.00.0030.0308.11

preferences:
66.02 ms | 401 KiB | 5 Q