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('c*asdf', $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.01318.31
8.3.50.0090.00922.07
8.3.40.0040.01118.80
8.3.30.0120.00318.92
8.3.20.0040.00420.20
8.3.10.0040.00422.05
8.3.00.0050.00322.52
8.2.180.0110.01116.75
8.2.170.0070.00722.96
8.2.160.0110.00420.78
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0050.00319.36
8.2.110.0000.01022.30
8.2.100.0080.00419.57
8.2.90.0030.00519.21
8.2.80.0000.00918.04
8.2.70.0070.00317.75
8.2.60.0000.00818.16
8.2.50.0030.00618.07
8.2.40.0000.00818.22
8.2.30.0060.00318.05
8.2.20.0000.00717.75
8.2.10.0040.00417.65
8.2.00.0040.00417.69
8.1.280.0090.00625.92
8.1.270.0060.00321.97
8.1.260.0090.00026.35
8.1.250.0090.00028.09
8.1.240.0040.00423.96
8.1.230.0000.01119.21
8.1.220.0060.00317.78
8.1.210.0060.00318.77
8.1.200.0000.00917.23
8.1.190.0000.00817.41
8.1.180.0030.00518.10
8.1.170.0030.00618.52
8.1.160.0000.00822.03
8.1.150.0050.00218.71
8.1.140.0000.00817.35
8.1.130.0000.00717.79
8.1.120.0050.00217.51
8.1.110.0000.00717.38
8.1.100.0030.00317.48
8.1.90.0030.00317.33
8.1.80.0000.00717.49
8.1.70.0000.00817.52
8.1.60.0040.00417.67
8.1.50.0000.00917.53
8.1.40.0000.00817.61
8.1.30.0050.00217.68
8.1.20.0030.00617.59
8.1.10.0080.00017.57
8.1.00.0040.00417.55
8.0.300.0000.00818.77
8.0.290.0080.00017.05
8.0.280.0070.00018.49
8.0.270.0070.00017.29
8.0.260.0040.00416.91
8.0.250.0070.00016.94
8.0.240.0070.00017.04
8.0.230.0040.00417.06
8.0.220.0030.00316.87
8.0.210.0000.00716.99
8.0.200.0070.00017.03
8.0.190.0080.00017.11
8.0.180.0040.00416.91
8.0.170.0050.00316.92
8.0.160.0050.00216.98
8.0.150.0000.00716.95
8.0.140.0040.00416.93
8.0.130.0070.00013.40
8.0.120.0080.00016.94
8.0.110.0070.00016.82
8.0.100.0020.00516.78
8.0.90.0040.00416.89
8.0.80.0110.01116.94
8.0.70.0000.00716.98
8.0.60.0040.00416.88
8.0.50.0040.00416.98
8.0.30.0110.01017.32
8.0.20.0080.01417.41
8.0.10.0000.00717.06
8.0.00.0050.01316.80
7.4.330.0050.00015.09
7.4.320.0060.00016.44
7.4.300.0030.00316.54
7.4.290.0040.00416.54
7.4.280.0050.00216.41
7.4.270.0030.00316.59
7.4.260.0030.00316.47
7.4.250.0040.00416.50
7.4.240.0000.00716.63
7.4.230.0030.00516.41
7.4.220.0090.00916.50
7.4.210.0050.01116.67
7.4.200.0000.00716.50
7.4.190.0030.00316.50
7.4.160.0130.00316.42
7.4.150.0060.01317.40
7.4.140.0100.00817.86
7.4.130.0060.01516.59
7.4.120.0130.00916.62
7.4.110.0090.00916.36
7.4.100.0120.00616.43
7.4.90.0150.00316.66
7.4.80.0070.01119.39
7.4.70.0040.01816.63
7.4.60.0090.01216.31
7.4.50.0020.00216.50
7.4.40.0090.00922.77
7.4.30.0080.00816.57
7.4.00.0030.00714.79
7.3.330.0030.00313.32
7.3.320.0000.00613.32
7.3.310.0070.00016.52
7.3.300.0030.00316.33
7.3.290.0070.00716.47
7.3.280.0100.01116.39
7.3.270.0120.00617.40
7.3.260.0140.00416.41
7.3.250.0120.00816.54
7.3.240.0120.00616.77
7.3.230.0100.00716.52
7.3.210.0130.00316.64
7.3.200.0030.01816.38
7.3.190.0090.01216.46
7.3.180.0100.00616.38
7.3.170.0130.01016.47
7.3.160.0040.01216.39
7.3.120.0100.00315.09
7.3.10.0060.00716.64
7.3.00.0080.00516.59
7.2.330.0030.01516.81
7.2.320.0090.01016.68
7.2.310.0120.00416.79
7.2.300.0080.00816.64
7.2.290.0030.01416.70
7.2.130.0040.00816.75
7.2.120.0080.00316.81
7.2.110.0030.01217.06
7.2.100.0090.00516.95
7.2.90.0020.00916.91
7.2.80.0060.00617.00
7.2.70.0080.00717.00
7.2.60.0050.00716.90
7.2.50.0030.00916.89
7.2.40.0070.00417.09
7.2.30.0060.00716.97
7.2.20.0100.00417.06
7.2.10.0090.00516.76
7.2.00.0070.00617.77
7.1.250.0070.00715.94
7.1.200.0070.00715.89
7.1.100.0620.00414.29
7.1.70.0070.00017.21
7.1.60.0140.01019.82
7.1.50.0070.01316.93
7.1.00.0100.07022.33
7.0.200.0050.00216.97
7.0.140.0070.06722.04
7.0.100.0200.07721.68
7.0.90.0000.05021.65
7.0.80.0070.08021.91
7.0.70.0170.05721.68
7.0.60.0070.05021.79
7.0.50.0070.08022.41
7.0.40.0070.08320.26
7.0.30.0100.08020.39
7.0.20.0070.07720.38
7.0.10.0130.06720.29
7.0.00.0000.09020.34
5.6.280.0000.07320.93
5.6.250.0030.07020.68
5.6.240.0100.08020.65
5.6.230.0130.07720.62
5.6.220.0030.05020.47
5.6.210.0070.07720.72
5.6.200.0130.07021.12
5.6.190.0100.07021.05
5.6.180.0100.07720.96
5.6.170.0130.08321.01
5.6.160.0130.05021.11
5.6.150.0030.08021.09
5.6.140.0070.07321.05
5.6.130.0030.07021.09
5.6.120.0030.06321.02
5.6.110.0100.08021.03
5.6.100.0130.05021.05
5.6.90.0070.08321.01
5.6.80.0000.08720.44
5.6.70.0030.08720.33
5.6.60.0130.07720.34
5.6.50.0130.06720.45
5.6.40.0070.06720.45
5.6.30.0070.07720.48
5.6.20.0130.06320.36
5.6.10.0100.04020.38
5.6.00.0030.07320.36
5.5.380.0070.04720.36
5.5.370.0100.07720.30
5.5.360.0070.08020.52
5.5.350.0070.07320.44
5.5.340.0200.07020.89
5.5.330.0070.08320.94
5.5.320.0100.05020.94
5.5.310.0130.08020.89
5.5.300.0100.07720.81
5.5.290.0130.08020.85
5.5.280.0030.05020.91
5.5.270.0030.07720.80
5.5.260.0100.04020.75
5.5.250.0130.06020.70
5.5.240.0070.08320.29
5.5.230.0070.08720.19
5.5.220.0100.08320.26
5.5.210.0000.09020.18
5.5.200.0200.07320.29
5.5.190.0100.07320.25
5.5.180.0070.08020.00
5.5.160.0000.08320.28
5.5.150.0100.07320.13
5.5.140.0000.04720.19
5.5.130.0030.08320.27
5.5.120.0130.06320.27
5.5.110.0030.08320.27
5.5.100.0070.07020.09
5.5.90.0100.07320.11
5.5.80.0030.07720.12
5.5.70.0100.07320.07
5.5.60.0170.06720.07
5.5.50.0070.07720.16
5.5.40.0100.08020.17
5.5.30.0070.07019.97
5.5.20.0170.04320.16
5.5.10.0100.07720.14
5.5.00.0100.07019.98
5.4.450.0070.05719.25
5.4.440.0000.08719.34
5.4.430.0070.05319.16
5.4.420.0100.08019.46
5.4.410.0070.07019.14
5.4.400.0030.08319.05
5.4.390.0030.06018.94
5.4.380.0030.05719.07
5.4.370.0070.06718.95
5.4.360.0100.07319.04
5.4.350.0030.07019.15
5.4.340.0070.06719.07
5.4.320.0030.08319.13
5.4.310.0000.04719.16
5.4.300.0100.07719.06
5.4.290.0070.07019.13
5.4.280.0070.07319.23
5.4.270.0030.06019.13
5.4.260.0100.05319.12
5.4.250.0100.07319.13
5.4.240.0100.07319.16
5.4.230.0070.08019.06
5.4.220.0130.07319.13
5.4.210.0070.04319.01
5.4.200.0030.04718.96
5.4.190.0030.08019.22
5.4.180.0000.07719.12
5.4.170.0070.06719.15
5.4.160.0070.08018.89
5.4.150.0070.07319.15
5.4.140.0000.07016.32
5.4.130.0130.05716.25
5.4.120.0000.06716.49
5.4.110.0030.04716.32
5.4.100.0030.08016.53
5.4.90.0000.07716.41
5.4.80.0030.07016.51
5.4.70.0130.07016.46
5.4.60.0100.07016.45
5.4.50.0000.04016.48
5.4.40.0100.07316.54
5.4.30.0070.07316.46
5.4.20.0000.07316.34
5.4.10.0100.04016.47
5.4.00.0030.05015.70
5.3.290.0100.07314.61
5.3.280.0070.07714.54
5.3.270.0070.07314.74
5.3.260.0070.07014.63
5.3.250.0100.07014.67
5.3.240.0070.04714.63
5.3.230.0000.08014.73
5.3.220.0200.05714.58
5.3.210.0070.05314.51
5.3.200.0070.04014.65
5.3.190.0030.08014.53
5.3.180.0000.05714.70
5.3.170.0030.08014.67
5.3.160.0100.07014.65
5.3.150.0070.05314.59
5.3.140.0070.06714.54
5.3.130.0100.05314.66
5.3.120.0030.06314.66
5.3.110.0030.08014.50
5.3.100.0100.07014.00
5.3.90.0000.07713.99
5.3.80.0030.07014.15
5.3.70.0170.05313.93
5.3.60.0100.06713.95
5.3.50.0030.07714.02
5.3.40.0000.08013.94
5.3.30.0100.06713.81
5.3.20.0030.07313.73
5.3.10.0070.06013.59
5.3.00.0100.07313.75
5.2.170.0100.03011.07
5.2.160.0030.06011.27
5.2.150.0030.07011.16
5.2.140.0030.06011.18
5.2.130.0070.05711.21
5.2.120.0100.03011.12
5.2.110.0030.06311.23
5.2.100.0000.06311.08
5.2.90.0070.06311.03
5.2.80.0070.06311.04
5.2.70.0030.06011.10
5.2.60.0070.06011.07
5.2.50.0030.06311.04
5.2.40.0070.06711.06
5.2.30.0070.06010.90
5.2.20.0030.06010.83
5.2.10.0070.04310.80
5.2.00.0030.04710.82
5.1.60.0030.03710.06
5.1.50.0070.0579.98
5.1.40.0070.05010.03
5.1.30.0030.06010.32
5.1.20.0170.04310.43
5.1.10.0000.05010.07
5.1.00.0070.05010.15
5.0.50.0000.0439.06
5.0.40.0100.0309.06
5.0.30.0030.0679.06
5.0.20.0030.0479.06
5.0.10.0030.0409.06
5.0.00.0100.0539.06
4.4.90.0000.0379.06
4.4.80.0000.0379.06
4.4.70.0000.0379.06
4.4.60.0070.0309.06
4.4.50.0030.0339.06
4.4.40.0070.0509.06
4.4.30.0000.0239.06
4.4.20.0070.0309.06
4.4.10.0000.0339.06
4.4.00.0070.0539.06
4.3.110.0070.0339.06
4.3.100.0000.0379.06
4.3.90.0030.0339.06
4.3.80.0000.0439.06
4.3.70.0070.0339.06
4.3.60.0000.0379.06
4.3.50.0000.0379.06
4.3.40.0030.0279.06
4.3.30.0000.0379.06
4.3.20.0070.0339.06
4.3.10.0030.0379.06
4.3.00.0000.0409.06

preferences:
46.45 ms | 400 KiB | 5 Q