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('H H H H H H H H', $testParts[0], $testParts[1], $testParts[2], $testParts[3], $testParts[4], $testParts[5], $testParts[6], $testParts[7]); $unpacked = unpack('H H H H H H H 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.0120.00618.68
8.3.50.0100.01021.27
8.3.40.0120.00918.71
8.3.30.0030.01420.35
8.3.20.0040.00420.07
8.3.10.0050.00222.09
8.3.00.0070.00022.34
8.2.180.0080.00816.75
8.2.170.0150.00322.96
8.2.160.0150.00022.13
8.2.150.0000.00724.18
8.2.140.0030.00524.66
8.2.130.0100.00326.16
8.2.120.0030.00619.48
8.2.110.0040.00422.25
8.2.100.0110.00018.03
8.2.90.0000.00817.95
8.2.80.0030.00617.97
8.2.70.0040.00417.75
8.2.60.0030.00518.05
8.2.50.0000.00818.07
8.2.40.0030.00617.97
8.2.30.0000.00918.13
8.2.20.0000.00717.73
8.2.10.0000.00717.84
8.2.00.0000.00917.86
8.1.280.0090.00625.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00620.84
8.1.230.0070.00420.84
8.1.220.0000.00817.79
8.1.210.0040.00418.88
8.1.200.0030.00617.22
8.1.190.0040.00417.54
8.1.180.0040.00419.14
8.1.170.0040.00418.52
8.1.160.0030.00320.91
8.1.150.0040.00418.60
8.1.140.0030.00517.42
8.1.130.0030.00317.75
8.1.120.0000.00717.41
8.1.110.0030.00517.38
8.1.100.0000.00717.49
8.1.90.0030.00717.50
8.1.80.0040.00417.52
8.1.70.0030.00317.45
8.1.60.0030.00517.53
8.1.50.0000.00717.46
8.1.40.0040.00417.61
8.1.30.0030.00617.48
8.1.20.0000.00817.61
8.1.10.0000.00817.50
8.1.00.0040.00417.56
8.0.300.0070.00019.98
8.0.290.0040.00417.04
8.0.280.0030.00318.40
8.0.270.0000.00817.01
8.0.260.0030.00316.89
8.0.250.0060.00017.03
8.0.240.0050.00317.05
8.0.230.0000.00717.00
8.0.220.0030.00317.04
8.0.210.0070.00017.03
8.0.200.0060.00016.93
8.0.190.0040.00417.02
8.0.180.0060.00317.01
8.0.170.0000.00817.02
8.0.160.0040.00416.96
8.0.150.0030.00616.88
8.0.140.0030.00516.88
8.0.130.0050.00013.38
8.0.120.0040.00416.96
8.0.110.0040.00417.00
8.0.100.0050.00216.84
8.0.90.0000.00816.86
8.0.80.0040.01116.96
8.0.70.0000.00717.00
8.0.60.0000.00717.02
8.0.50.0030.00516.86
8.0.30.0150.00717.13
8.0.20.0090.01017.40
8.0.10.0080.00017.13
8.0.00.0080.01016.61
7.4.330.0000.00715.00
7.4.320.0000.00716.43
7.4.300.0060.00016.54
7.4.290.0030.00616.61
7.4.280.0040.00416.66
7.4.270.0000.00716.60
7.4.260.0050.00013.24
7.4.250.0040.00416.57
7.4.240.0030.00316.59
7.4.230.0000.00716.71
7.4.220.0130.00616.70
7.4.210.0040.01216.51
7.4.200.0000.00816.61
7.4.190.0000.00816.51
7.4.160.0060.01216.87
7.4.150.0080.00817.40
7.4.140.0100.00717.86
7.4.130.0110.00616.54
7.4.120.0110.01016.55
7.4.110.0050.01416.47
7.4.100.0140.00316.50
7.4.90.0090.00916.65
7.4.80.0080.00819.39
7.4.70.0070.01016.59
7.4.60.0180.00016.46
7.4.50.0050.00016.23
7.4.40.0070.01122.77
7.4.30.0140.00416.70
7.4.00.0140.00014.92
7.3.330.0030.00313.43
7.3.320.0050.00013.39
7.3.310.0040.00416.45
7.3.300.0000.00716.31
7.3.290.0060.01216.28
7.3.280.0040.01116.38
7.3.270.0100.00717.40
7.3.260.0100.00716.50
7.3.250.0110.01016.57
7.3.240.0100.00716.68
7.3.230.0150.00416.66
7.3.210.0070.01116.60
7.3.200.0040.01316.43
7.3.190.0090.00916.36
7.3.180.0130.00316.50
7.3.170.0040.01316.55
7.3.160.0100.00716.42
7.3.120.0140.00314.47
7.3.110.0060.01214.74
7.3.100.0100.00314.65
7.3.90.0030.01014.73
7.3.80.0030.01415.06
7.3.70.0120.00614.84
7.3.60.0190.00314.84
7.3.50.0080.00814.75
7.3.40.0040.00714.69
7.3.30.0000.01014.80
7.3.20.0070.00416.53
7.3.10.0110.00716.44
7.3.00.0060.00316.62
7.2.330.0070.01016.73
7.2.320.0120.00516.79
7.2.310.0030.01316.61
7.2.300.0070.01016.76
7.2.290.0090.00916.59
7.2.240.0030.00615.18
7.2.230.0090.00315.25
7.2.220.0080.00814.98
7.2.210.0030.01214.86
7.2.200.0100.01015.09
7.2.190.0120.00814.88
7.2.180.0090.00614.94
7.2.170.0060.00914.81
7.2.160.0030.01314.83
7.2.150.0060.01016.88
7.2.140.0140.00316.95
7.2.130.0100.00716.80
7.2.120.0040.00816.53
7.2.110.0090.00616.55
7.2.100.0070.00716.92
7.2.90.0070.00416.93
7.2.80.0110.00516.86
7.2.70.0150.00016.80
7.2.60.0030.00916.80
7.2.50.0070.01016.80
7.2.40.0030.00616.90
7.2.30.0030.01316.86
7.2.20.0080.00616.93
7.2.10.0080.00816.60
7.2.00.0050.00918.27
7.1.330.0040.01115.83
7.1.320.0070.01115.46
7.1.310.0060.00315.61
7.1.300.0120.00815.53
7.1.290.0120.00315.39
7.1.280.0040.01115.59
7.1.270.0060.00615.71
7.1.260.0040.01115.43
7.1.250.0060.00815.67
7.1.200.0040.00715.49
7.1.100.0000.01317.85
7.1.70.0030.00917.19
7.1.60.0230.00319.32
7.1.50.0040.01816.95
7.1.00.0070.06022.41
7.0.200.0270.00714.88
7.0.140.0000.08022.21
7.0.100.0130.07020.02
7.0.90.0000.07319.92
7.0.80.0270.07320.16
7.0.70.0200.07019.86
7.0.60.0030.05319.98
7.0.50.0070.04320.31
7.0.40.0170.03020.13
7.0.30.0030.04320.03
7.0.20.0030.04720.05
7.0.10.0070.04020.16
7.0.00.0030.03720.14
5.6.280.0000.07721.14
5.6.250.0130.05720.57
5.6.240.0170.07320.61
5.6.230.0070.08320.60
5.6.220.0070.05720.74
5.6.210.0070.07020.57
5.6.200.0070.06020.95
5.6.190.0030.04721.09
5.6.180.0100.03321.12
5.6.170.0000.05020.96
5.6.160.0070.04321.07
5.6.150.0070.03021.09
5.6.140.0100.06020.96
5.6.130.0070.03321.18
5.6.120.0000.04321.12
5.6.110.0070.03721.08
5.6.100.0030.03721.13
5.6.90.0030.04320.93
5.6.80.0070.03020.41
5.6.70.0130.03020.46
5.6.60.0000.03720.34
5.6.50.0030.03720.49
5.6.40.0030.03320.31
5.6.30.0000.03720.32
5.6.20.0000.03720.26
5.6.10.0030.03320.29
5.6.00.0070.03020.42
5.5.380.0030.05320.35
5.5.370.0070.07720.52
5.5.360.0130.05720.39
5.5.350.0030.08320.47
5.5.340.0070.04020.77
5.5.330.0100.03720.88
5.5.320.0030.04320.74
5.5.310.0070.03720.87
5.5.300.0070.03020.81
5.5.290.0000.04020.84
5.5.280.0030.05320.80
5.5.270.0070.03020.91
5.5.260.0100.04020.84
5.5.250.0030.03320.72
5.5.240.0070.03020.19
5.5.230.0030.03320.14
5.5.220.0130.03020.30
5.5.210.0030.03320.18
5.5.200.0030.03320.09
5.5.190.0030.03320.24
5.5.180.0070.03020.09
5.5.160.0030.03720.11
5.5.150.0000.03320.16
5.5.140.0070.03320.16
5.5.130.0030.03320.22
5.5.120.0030.03320.15
5.5.110.0100.02720.26
5.5.100.0000.03720.08
5.5.90.0070.03020.12
5.5.80.0000.03720.19
5.5.70.0100.07020.15
5.5.60.0070.09019.95
5.5.50.0070.08020.14
5.5.40.0070.07020.09
5.5.30.0000.04720.12
5.5.20.0070.03720.06
5.5.10.0030.06719.96
5.5.00.0030.03720.10
5.4.450.0070.03719.36
5.4.440.0030.03719.49
5.4.430.0030.03319.45
5.4.420.0030.03319.20
5.4.410.0000.04319.11
5.4.400.0170.02019.24
5.4.390.0100.02719.18
5.4.380.0070.03019.23
5.4.370.0070.03319.04
5.4.360.0000.03319.18
5.4.350.0030.03018.88
5.4.340.0030.03719.20
5.4.320.0030.03319.04
5.4.310.0100.02719.23
5.4.300.0000.03318.88
5.4.290.0070.03018.89
5.4.280.0100.02719.03
5.4.270.0000.03319.02
5.4.260.0070.03718.86
5.4.250.0030.04319.12
5.4.240.0070.04019.12
5.4.230.0030.04019.11
5.4.220.0130.07719.12
5.4.210.0130.06719.23
5.4.200.0130.06319.21
5.4.190.0130.06719.02
5.4.180.0030.05718.89
5.4.170.0070.04319.15
5.4.160.0030.08318.93
5.4.150.0030.08019.11
5.4.140.0030.04016.46
5.4.130.0070.07716.24
5.4.120.0130.03016.40
5.4.110.0130.07016.39
5.4.100.0170.04016.58
5.4.90.0100.06316.53
5.4.80.0100.03316.38
5.4.70.0100.04016.46
5.4.60.0030.06316.40
5.4.50.0030.07716.24
5.4.40.0130.06716.36
5.4.30.0070.06016.48
5.4.20.0130.05316.32
5.4.10.0100.07016.49
5.4.00.0070.08715.86
5.3.290.0070.03014.73
5.3.280.0100.07014.72
5.3.270.0030.08314.63
5.3.260.0100.06314.70
5.3.250.0070.04314.61
5.3.240.0030.04014.63
5.3.230.0070.07714.57
5.3.220.0070.06714.53
5.3.210.0070.07014.51
5.3.200.0100.07314.66
5.3.190.0100.07014.64
5.3.180.0030.08314.66
5.3.170.0030.03714.64
5.3.160.0070.04314.54
5.3.150.0000.03714.59
5.3.140.0030.08014.54
5.3.130.0070.07314.61
5.3.120.0070.05714.70
5.3.110.0100.07014.61
5.3.100.0000.04714.07
5.3.90.0030.07714.00
5.3.80.0030.04014.07
5.3.70.0030.08014.00
5.3.60.0070.07014.02
5.3.50.0070.07313.96
5.3.40.0000.04713.88
5.3.30.0070.07013.98
5.3.20.0130.06313.76
5.3.10.0030.03713.73
5.3.00.0070.07713.79
5.2.170.0030.03311.20
5.2.160.0000.06011.24
5.2.150.0030.05311.29
5.2.140.0030.06011.03
5.2.130.0030.03311.18
5.2.120.0130.03711.02
5.2.110.0100.05711.02
5.2.100.0030.03311.21
5.2.90.0000.04710.97
5.2.80.0000.03311.24
5.2.70.0000.04710.98
5.2.60.0000.04311.10
5.2.50.0030.06010.90
5.2.40.0030.03010.89
5.2.30.0070.06011.00
5.2.20.0000.05711.07
5.2.10.0100.02310.87
5.2.00.0000.03710.68
5.1.60.0100.04710.12
5.1.50.0030.04710.05
5.1.40.0070.0439.87
5.1.30.0000.04010.38
5.1.20.0100.02310.29
5.1.10.0030.02710.11
5.1.00.0070.04010.07
5.0.50.0070.0438.61
5.0.40.0070.0278.61
5.0.30.0030.0678.61
5.0.20.0100.0378.61
5.0.10.0070.0278.61
5.0.00.0030.0608.61
4.4.90.0000.0208.61
4.4.80.0030.0408.61
4.4.70.0000.0278.61
4.4.60.0030.0208.61
4.4.50.0000.0378.61
4.4.40.0030.0278.61
4.4.30.0030.0338.61
4.4.20.0000.0378.61
4.4.10.0030.0308.61
4.4.00.0030.0238.61
4.3.110.0000.0238.61
4.3.100.0130.0238.61
4.3.90.0000.0378.61
4.3.80.0100.0508.61
4.3.70.0030.0338.61
4.3.60.0030.0308.61
4.3.50.0000.0338.61
4.3.40.0030.0508.61
4.3.30.0030.0338.61
4.3.20.0000.0338.61
4.3.10.0000.0208.61
4.3.00.0030.0338.61

preferences:
45.73 ms | 401 KiB | 5 Q