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('H*', $testHex[0], $testHex[1], $testHex[2], $testHex[3], $testHex[4], $testHex[5], $testHex[6], $testHex[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.0170.00318.55
8.3.50.0080.01221.99
8.3.40.0110.01118.98
8.3.30.0150.00620.13
8.3.20.0040.00420.35
8.3.10.0070.00022.08
8.3.00.0040.00422.45
8.2.180.0120.00916.75
8.2.170.0090.00622.96
8.2.160.0110.00422.25
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00417.75
8.2.110.0030.00720.37
8.2.100.0090.00318.03
8.2.90.0000.00819.36
8.2.80.0080.00019.41
8.2.70.0000.00817.63
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0000.00818.22
8.2.30.0000.00918.16
8.2.20.0000.00717.77
8.2.10.0000.00917.84
8.2.00.0080.00017.70
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0100.00023.79
8.1.230.0040.00720.88
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0100.00017.35
8.1.190.0080.00017.26
8.1.180.0040.00419.01
8.1.170.0080.00018.58
8.1.160.0040.00420.96
8.1.150.0000.00718.60
8.1.140.0050.00317.48
8.1.130.0040.00417.86
8.1.120.0070.00017.40
8.1.110.0050.00317.53
8.1.100.0020.00517.50
8.1.90.0070.00017.46
8.1.80.0000.00717.39
8.1.70.0000.00717.43
8.1.60.0060.00317.55
8.1.50.0070.00017.46
8.1.40.0040.00417.38
8.1.30.0030.00617.62
8.1.20.0030.00517.64
8.1.10.0000.00917.52
8.1.00.0030.00517.47
8.0.300.0070.00018.77
8.0.290.0000.00717.05
8.0.280.0030.00318.42
8.0.270.0000.00717.28
8.0.260.0030.00316.83
8.0.250.0040.00416.97
8.0.240.0050.00316.96
8.0.230.0000.00717.07
8.0.220.0050.00216.85
8.0.210.0000.00717.03
8.0.200.0040.00417.05
8.0.190.0080.00017.04
8.0.180.0000.00717.04
8.0.170.0080.00017.08
8.0.160.0050.00316.88
8.0.150.0030.00617.04
8.0.140.0000.00716.89
8.0.130.0000.00513.50
8.0.120.0050.00316.92
8.0.110.0070.00016.92
8.0.100.0030.00516.94
8.0.90.0000.00817.04
8.0.80.0030.01416.94
8.0.70.0000.00717.06
8.0.60.0040.00416.98
8.0.50.0050.00316.96
8.0.30.0110.00917.05
8.0.20.0090.01317.40
8.0.10.0040.00417.10
8.0.00.0120.00616.97
7.4.330.0030.00315.00
7.4.320.0030.00316.53
7.4.300.0030.00316.68
7.4.290.0040.00716.43
7.4.280.0020.00516.46
7.4.270.0070.00016.40
7.4.260.0070.00013.43
7.4.250.0040.00416.60
7.4.240.0020.00516.66
7.4.230.0000.00716.66
7.4.220.0060.01216.59
7.4.210.0090.00716.63
7.4.200.0030.00316.29
7.4.190.0000.00716.54
7.4.160.0170.00716.83
7.4.150.0110.00717.40
7.4.140.0140.00517.86
7.4.130.0110.00716.53
7.4.120.0110.01116.65
7.4.110.0200.00816.59
7.4.100.0130.00616.53
7.4.90.0150.00316.61
7.4.80.0070.01419.39
7.4.70.0130.00316.52
7.4.60.0120.00616.43
7.4.50.0030.00516.47
7.4.40.0070.01122.77
7.4.30.0140.00916.64
7.4.00.0040.00714.69
7.3.330.0000.00513.43
7.3.320.0000.00513.27
7.3.310.0050.00216.46
7.3.300.0030.00316.34
7.3.290.0020.01816.47
7.3.280.0070.01016.47
7.3.270.0080.00817.40
7.3.260.0120.00616.47
7.3.250.0060.01216.50
7.3.240.0120.00616.63
7.3.230.0120.00816.50
7.3.210.0110.00816.62
7.3.200.0160.00319.39
7.3.190.0060.01316.45
7.3.180.0100.00616.40
7.3.170.0060.01116.73
7.3.160.0160.00016.50
7.3.120.0040.00815.02
7.2.330.0090.00916.84
7.2.320.0130.01016.51
7.2.310.0160.00316.78
7.2.300.0030.01316.82
7.2.290.0110.00716.79
7.2.60.0000.01416.78
7.2.00.0000.01619.48
7.1.200.0080.00015.77
7.1.100.0040.00718.25
7.1.70.0000.00817.10
7.1.60.0120.00919.32
7.1.50.0100.01316.91
7.1.00.0070.03022.40
7.0.200.0130.00714.90
7.0.140.0000.07721.95
7.0.100.0000.04319.94
7.0.90.0030.06319.98
7.0.80.0070.03719.99
7.0.70.0030.04719.96
7.0.60.0100.03320.05
7.0.50.0070.04020.30
7.0.40.0070.04320.13
7.0.30.0000.06020.04
7.0.20.0000.04720.07
7.0.10.0030.04020.14
7.0.00.0100.05020.05
5.6.280.0070.07021.08
5.6.250.0100.04320.76
5.6.240.0030.07320.53
5.6.230.0070.06720.68
5.6.220.0070.04020.69
5.6.210.0030.04320.45
5.6.200.0100.04021.15
5.6.190.0130.06720.98
5.6.180.0070.03721.13
5.6.170.0030.04021.18
5.6.160.0070.03720.98
5.6.150.0030.04020.95
5.6.140.0030.04020.95
5.6.130.0030.04321.03
5.6.120.0000.04721.10
5.6.110.0030.04321.05
5.6.100.0070.04021.06
5.6.90.0100.06721.03
5.6.80.0070.08020.42
5.6.70.0070.08320.43
5.6.60.0030.05020.34
5.6.50.0030.08020.51
5.6.40.0100.07320.38
5.6.30.0100.07320.46
5.6.20.0070.07720.41
5.6.10.0070.07720.54
5.6.00.0130.07020.46
5.5.380.0130.07720.53
5.5.370.0070.03320.53
5.5.360.0030.04320.45
5.5.350.0000.04320.39
5.5.340.0200.03020.75
5.5.330.0030.06320.92
5.5.320.0070.03720.75
5.5.310.0100.03720.75
5.5.300.0030.04320.91
5.5.290.0100.03720.88
5.5.280.0030.04020.81
5.5.270.0000.04720.85
5.5.260.0070.06020.93
5.5.250.0070.04320.46
5.5.240.0100.08020.23
5.5.230.0100.08019.99
5.5.220.0130.07020.26
5.5.210.0070.05320.29
5.5.200.0070.07719.97
5.5.190.0100.07720.13
5.5.180.0100.07720.19
5.5.160.0170.07020.01
5.5.150.0070.06720.14
5.5.140.0030.08720.26
5.5.130.0030.08020.23
5.5.120.0000.05320.17
5.5.110.0070.04720.22
5.5.100.0070.08320.11
5.5.90.0030.07720.11
5.5.80.0070.06020.14
5.5.70.0100.07720.08
5.5.60.0130.07020.07
5.5.50.0030.06720.05
5.5.40.0000.08020.07
5.5.30.0070.08320.11
5.5.20.0070.04719.97
5.5.10.0100.04320.07
5.5.00.0000.08320.09
5.4.450.0030.04019.23
5.4.440.0070.04319.46
5.4.430.0000.04319.20
5.4.420.0000.04019.46
5.4.410.0000.04319.33
5.4.400.0070.05719.14
5.4.390.0100.07319.05
5.4.380.0070.07319.14
5.4.370.0100.07318.88
5.4.360.0130.07319.05
5.4.350.0100.07018.88
5.4.340.0070.07019.17
5.4.320.0070.07719.05
5.4.310.0100.04019.04
5.4.300.0100.07019.21
5.4.290.0130.04019.13
5.4.280.0030.07019.03
5.4.270.0100.07019.16
5.4.260.0070.08019.14
5.4.250.0030.08319.03
5.4.240.0100.07718.90
5.4.230.0000.07718.88
5.4.220.0130.06718.89
5.4.210.0070.07018.88
5.4.200.0070.08019.09
5.4.190.0130.07018.82
5.4.180.0100.07019.04
5.4.170.0130.06719.04
5.4.160.0100.07319.16
5.4.150.0030.08018.88
5.4.140.0100.06716.52
5.4.130.0030.07316.46
5.4.120.0070.07316.38
5.4.110.0070.07316.55
5.4.100.0130.06716.57
5.4.90.0100.07016.49
5.4.80.0030.07016.47
5.4.70.0100.07316.53
5.4.60.0030.04716.49
5.4.50.0170.06316.27
5.4.40.0070.05716.52
5.4.30.0070.06716.45
5.4.20.0070.07316.46
5.4.10.0070.07016.44
5.4.00.0070.07315.64
5.3.290.0130.07314.82
5.3.280.0130.07014.59
5.3.270.0000.08314.63
5.3.260.0030.05014.60
5.3.250.0070.07314.61
5.3.240.0030.08314.61
5.3.230.0030.08314.75
5.3.220.0100.05714.61
5.3.210.0130.07014.70
5.3.200.0070.07714.56
5.3.190.0000.08314.51
5.3.180.0070.05714.54
5.3.170.0130.06014.54
5.3.160.0100.07314.53
5.3.150.0070.07314.69
5.3.140.0170.06314.55
5.3.130.0030.04714.54
5.3.120.0130.07014.63
5.3.110.0030.04714.55
5.3.100.0070.04314.04
5.3.90.0130.03714.01
5.3.80.0000.08014.09
5.3.70.0100.07314.14
5.3.60.0070.07314.05
5.3.50.0030.07714.00
5.3.40.0070.07314.10
5.3.30.0100.04013.86
5.3.20.0100.07013.64
5.3.10.0070.06013.79
5.3.00.0030.05313.64
5.2.170.0030.03711.28
5.2.160.0070.06311.22
5.2.150.0070.06011.09
5.2.140.0030.05711.16
5.2.130.0030.04011.25
5.2.120.0000.04010.98
5.2.110.0070.06311.05
5.2.100.0070.06711.23
5.2.90.0070.04710.98
5.2.80.0100.05711.16
5.2.70.0030.06011.03
5.2.60.0030.04311.18
5.2.50.0030.06711.07
5.2.40.0030.06011.04
5.2.30.0000.06311.04
5.2.20.0000.06310.89
5.2.10.0070.06011.00
5.2.00.0030.06010.75
5.1.60.0100.04710.28
5.1.50.0030.03710.28
5.1.40.0000.03710.28
5.1.30.0100.05010.46
5.1.20.0100.03310.36
5.1.10.0000.05710.28
5.1.00.0000.05710.28
5.0.50.0030.04710.28
5.0.40.0000.04710.28
5.0.30.0000.07010.28
5.0.20.0070.04010.28
5.0.10.0030.04310.28
5.0.00.0030.06710.28
4.4.90.0100.02710.28
4.4.80.0000.03710.28
4.4.70.0000.02710.28
4.4.60.0000.03710.28
4.4.50.0000.03310.28
4.4.40.0070.04310.28
4.4.30.0030.03710.28
4.4.20.0070.03310.28
4.4.10.0000.02310.28
4.4.00.0000.05310.28
4.3.110.0030.03310.28
4.3.100.0000.02310.28
4.3.90.0000.03710.28
4.3.80.0030.05310.28
4.3.70.0030.03310.28
4.3.60.0100.03010.28
4.3.50.0030.03310.28
4.3.40.0000.05310.28
4.3.30.0000.02310.28
4.3.20.0000.03710.28
4.3.10.0030.03710.28
4.3.00.0000.03710.28

preferences:
53.91 ms | 401 KiB | 5 Q