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)); //echo strToHex($testPart) . "<br>\n"; } $packed = pack('xH*', $testParts[0], $testParts[1], $testParts[2], $testParts[3], $testParts[4], $testParts[5], $testParts[6], $testParts[7]); $unpacked = unpack('H*', $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.0060.00918.31
8.3.50.0100.00822.11
8.3.40.0120.00618.79
8.3.30.0140.00720.34
8.3.20.0070.00020.29
8.3.10.0040.00422.10
8.3.00.0080.00022.58
8.2.180.0090.01218.29
8.2.170.0100.01018.91
8.2.160.0130.00322.96
8.2.150.0030.00525.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00419.49
8.2.110.0100.00022.13
8.2.100.0110.00017.97
8.2.90.0040.00419.17
8.2.80.0050.00319.34
8.2.70.0040.00417.63
8.2.60.0000.00818.03
8.2.50.0040.00418.07
8.2.40.0000.00818.10
8.2.30.0030.00618.25
8.2.20.0050.00317.61
8.2.10.0000.00817.74
8.2.00.0000.00817.88
8.1.280.0100.00725.92
8.1.270.0040.00423.88
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0100.00023.71
8.1.230.0040.00719.21
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0090.00017.22
8.1.190.0030.00517.53
8.1.180.0040.00418.88
8.1.170.0030.00618.61
8.1.160.0000.00719.02
8.1.150.0040.00418.62
8.1.140.0000.00817.54
8.1.130.0070.00017.91
8.1.120.0040.00417.40
8.1.110.0040.00417.38
8.1.100.0000.00817.43
8.1.90.0040.00417.46
8.1.80.0040.00417.46
8.1.70.0030.00317.45
8.1.60.0000.00917.49
8.1.50.0080.00017.61
8.1.40.0030.00617.43
8.1.30.0050.00317.61
8.1.20.0060.00317.67
8.1.10.0030.00517.53
8.1.00.0040.00417.50
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0050.00318.46
8.0.270.0000.00817.15
8.0.260.0030.00316.90
8.0.250.0000.00716.92
8.0.240.0000.00817.05
8.0.230.0030.00316.96
8.0.220.0030.00317.02
8.0.210.0070.00016.98
8.0.200.0000.00717.04
8.0.190.0070.00016.95
8.0.180.0040.00417.00
8.0.170.0040.00417.02
8.0.160.0030.00316.90
8.0.150.0050.00316.76
8.0.140.0040.00316.85
8.0.130.0000.00513.36
8.0.120.0080.00016.90
8.0.110.0070.00017.00
8.0.100.0000.00716.87
8.0.90.0000.00716.76
8.0.80.0150.00016.98
8.0.70.0000.00716.92
8.0.60.0000.00716.77
8.0.50.0000.00816.83
8.0.30.0110.00717.05
8.0.20.0130.00817.40
8.0.10.0070.00017.08
8.0.00.0100.00816.74
7.4.330.0030.00315.00
7.4.320.0060.00016.53
7.4.300.0030.00316.43
7.4.290.0100.00016.54
7.4.280.0070.00016.62
7.4.270.0030.00316.61
7.4.260.0040.00416.45
7.4.250.0040.00416.56
7.4.240.0040.00316.62
7.4.230.0030.00316.72
7.4.220.0090.00916.61
7.4.210.0050.01016.62
7.4.200.0000.00716.63
7.4.190.0050.00216.79
7.4.160.0060.00916.72
7.4.150.0100.00717.40
7.4.140.0160.00517.86
7.4.130.0120.00516.51
7.4.120.0100.00716.66
7.4.110.0110.01516.56
7.4.100.0030.01816.36
7.4.90.0120.01216.46
7.4.80.0200.01019.39
7.4.70.0140.00316.41
7.4.60.0060.01016.39
7.4.50.0090.00016.59
7.4.40.0040.01522.77
7.4.30.0040.01316.37
7.4.00.0030.00914.83
7.3.330.0030.00313.28
7.3.320.0000.00513.52
7.3.310.0030.00316.55
7.3.300.0030.00316.37
7.3.290.0090.00916.41
7.3.280.0100.00616.40
7.3.270.0160.00317.40
7.3.260.0140.00716.55
7.3.250.0130.00716.56
7.3.240.0120.00416.49
7.3.230.0100.00716.43
7.3.210.0060.01216.50
7.3.200.0190.00419.39
7.3.190.0140.01016.44
7.3.180.0060.00916.47
7.3.170.0120.00616.70
7.3.160.0100.00616.39
7.3.120.0090.00615.04
7.2.330.0070.01416.44
7.2.320.0150.00316.70
7.2.310.0140.00316.66
7.2.300.0130.00316.86
7.2.290.0130.00316.70
7.2.60.0030.01016.89
7.2.00.0070.01019.55
7.1.200.0040.00815.53
7.1.100.0070.00718.18
7.1.70.0000.00717.28
7.1.60.0110.01519.32
7.1.50.0100.01017.00
7.1.00.0030.03322.30
7.0.200.0150.00414.83
7.0.140.0070.07022.12
7.0.60.0070.03720.05
7.0.50.0070.03717.89
7.0.40.0170.08020.11
7.0.30.0230.04720.23
7.0.20.0370.07320.24
7.0.10.0100.04720.07
7.0.00.0030.06320.32
5.6.280.0000.07721.10
5.6.210.0100.08320.63
5.6.200.0000.05318.15
5.6.190.0000.06720.50
5.6.180.0070.05020.57
5.6.170.0270.08320.55
5.6.160.0070.08720.46
5.6.150.0100.07718.14
5.6.140.0070.03718.18
5.6.130.0130.04718.29
5.6.120.0100.07321.00
5.6.110.0230.07320.96
5.6.100.0170.07320.98
5.6.90.0100.07321.05
5.6.80.0030.05020.39
5.5.350.0000.03320.38
5.5.340.0130.07317.98
5.5.330.0030.07320.41
5.5.320.0230.07720.36
5.5.310.0130.04720.30
5.5.300.0130.03317.95
5.5.290.0100.06017.97
5.5.280.0100.04320.75
5.5.270.0100.05020.73
5.5.260.0070.08020.76
5.5.250.0030.06720.48
5.5.240.0100.06020.16
5.4.450.0030.03719.28
5.4.440.0000.05019.64
5.4.430.0130.03319.64
5.4.420.0030.03719.46
5.4.410.0000.05319.36
5.4.400.0030.04319.32
5.4.390.0100.06019.15
5.4.380.0030.04719.00
5.4.370.0070.04019.13
5.4.360.0000.08319.09
5.4.350.0030.03319.15
5.4.340.0070.03319.18
5.4.320.0030.03319.01
5.4.310.0030.06719.00
5.4.300.0000.03718.85
5.4.290.0100.05019.24
5.4.280.0000.06719.13
5.4.270.0000.05319.06
5.4.260.0030.07719.06
5.4.250.0030.04319.08
5.4.240.0000.04719.31
5.4.230.0070.04019.21
5.4.220.0030.04018.94
5.4.210.0000.04018.98
5.4.200.0030.04319.21
5.4.190.0070.06718.84
5.4.180.0030.03318.86
5.4.170.0000.05019.07
5.4.160.0030.04019.12
5.4.150.0000.06319.06
5.4.140.0030.04316.40
5.4.130.0030.04716.41
5.4.120.0000.04016.57
5.4.110.0000.04016.30
5.4.100.0070.04016.50
5.4.90.0030.03316.41
5.4.80.0000.03716.49
5.4.70.0030.03316.40
5.4.60.0030.03316.51
5.4.50.0000.03716.43
5.4.40.0000.04316.16
5.4.30.0030.03316.18
5.4.20.0000.03316.42
5.4.10.0030.03016.43
5.4.00.0000.03715.84
5.3.290.0000.03714.59
5.3.280.0000.04014.59
5.3.270.0000.04714.52
5.3.260.0000.04714.73
5.3.250.0000.05014.59
5.3.240.0030.04014.58
5.3.230.0030.05714.61
5.3.220.0070.04714.55
5.3.210.0130.03714.70
5.3.200.0000.05714.48
5.3.190.0000.03714.66
5.3.180.0000.04014.47
5.3.170.0030.03314.62
5.3.160.0030.03314.62
5.3.150.0030.03314.50
5.3.140.0000.04314.54
5.3.130.0070.03014.71
5.3.120.0000.04314.48
5.3.110.0170.03314.55
5.3.100.0000.03314.08
5.3.90.0030.03314.07
5.3.80.0000.03314.00
5.3.70.0000.04013.92
5.3.60.0000.04014.10
5.3.50.0000.03313.88
5.3.40.0030.03713.94
5.3.30.0030.03013.86
5.3.20.0030.04013.79
5.3.10.0000.03313.59
5.3.00.0070.03013.55
5.2.170.0000.03011.05
5.2.160.0000.03311.07
5.2.150.0000.03311.16
5.2.140.0100.02711.27
5.2.130.0000.02711.02
5.2.120.0030.02311.27
5.2.110.0000.03011.28
5.2.100.0000.03311.16
5.2.90.0000.03011.07
5.2.80.0000.02711.10
5.2.70.0030.02311.18
5.2.60.0000.03011.05
5.2.50.0030.02710.93
5.2.40.0000.02710.92
5.2.30.0000.03010.98
5.2.20.0030.02710.98
5.2.10.0000.02711.02
5.2.00.0000.02710.71
5.1.60.0030.02010.41
5.1.50.0000.02710.41
5.1.40.0030.02010.41
5.1.30.0030.02310.41
5.1.20.0000.02310.41
5.1.10.0030.02310.41
5.1.00.0000.02710.41
5.0.50.0000.02310.41
5.0.40.0000.02310.41
5.0.30.0000.03710.41
5.0.20.0000.02010.41
5.0.10.0000.02310.41
5.0.00.0070.03010.41
4.4.90.0000.01710.41
4.4.80.0030.01310.41
4.4.70.0000.02010.41
4.4.60.0030.01010.41
4.4.50.0000.01310.41
4.4.40.0070.01710.41
4.4.30.0000.01310.41
4.4.20.0000.01710.41
4.4.10.0000.01310.41
4.4.00.0000.04310.41
4.3.110.0000.02010.41
4.3.100.0000.02010.41
4.3.90.0000.01310.41
4.3.80.0000.02310.41
4.3.70.0000.02010.41
4.3.60.0030.01010.41
4.3.50.0000.01710.41
4.3.40.0030.03710.41
4.3.30.0030.02310.41
4.3.20.0030.03710.41
4.3.10.0000.02010.41
4.3.00.0030.01710.41

preferences:
48.13 ms | 401 KiB | 5 Q