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('HHHHHHHH', $testParts[0], $testParts[1], $testParts[2], $testParts[3], $testParts[4], $testParts[5], $testParts[6], $testParts[7]); $unpacked = unpack('HHHHHHHH', $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.00718.30
8.3.50.0260.00521.14
8.3.40.0120.00318.84
8.3.30.0100.00320.26
8.3.20.0040.00420.16
8.3.10.0040.00422.05
8.3.00.0050.00322.48
8.2.180.0100.00716.63
8.2.170.0100.00722.96
8.2.160.0100.00322.20
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0080.00019.36
8.2.110.0030.00622.30
8.2.100.0120.00017.91
8.2.90.0040.00419.17
8.2.80.0040.00419.40
8.2.70.0000.00817.63
8.2.60.0030.00618.05
8.2.50.0000.00818.07
8.2.40.0000.00818.34
8.2.30.0060.00318.09
8.2.20.0000.00817.81
8.2.10.0040.00417.83
8.2.00.0060.00317.64
8.1.280.0110.00425.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0050.00228.09
8.1.240.0130.00622.06
8.1.230.0040.00819.17
8.1.220.0040.00417.88
8.1.210.0000.00818.77
8.1.200.0080.00017.35
8.1.190.0040.00417.41
8.1.180.0090.00019.01
8.1.170.0060.00318.59
8.1.160.0070.00018.91
8.1.150.0070.00018.59
8.1.140.0040.00417.48
8.1.130.0030.00317.85
8.1.120.0000.00717.38
8.1.110.0000.00817.49
8.1.100.0000.00717.51
8.1.90.0030.00617.49
8.1.80.0000.00717.34
8.1.70.0000.00717.34
8.1.60.0040.00417.47
8.1.50.0040.00417.44
8.1.40.0040.00417.44
8.1.30.0040.00417.63
8.1.20.0060.00317.71
8.1.10.0000.00817.62
8.1.00.0040.00417.53
8.0.300.0000.00718.77
8.0.290.0050.00317.18
8.0.280.0000.00718.47
8.0.270.0000.00717.21
8.0.260.0060.00016.76
8.0.250.0030.00316.88
8.0.240.0000.00717.03
8.0.230.0030.00316.93
8.0.220.0000.00716.82
8.0.210.0030.00316.78
8.0.200.0000.00616.90
8.0.190.0040.00416.98
8.0.180.0040.00416.82
8.0.170.0000.00816.90
8.0.160.0070.00016.87
8.0.150.0070.00016.96
8.0.140.0040.00416.77
8.0.130.0060.00013.38
8.0.120.0000.00816.80
8.0.110.0070.00016.98
8.0.100.0050.00316.79
8.0.90.0050.00216.93
8.0.80.0110.00416.96
8.0.70.0020.00516.73
8.0.60.0040.00416.82
8.0.50.0050.00316.95
8.0.30.0150.00516.96
8.0.20.0100.00817.40
8.0.10.0040.00416.82
8.0.00.0110.01116.89
7.4.330.0060.00015.00
7.4.320.0060.00016.52
7.4.300.0000.00616.41
7.4.290.0000.00716.63
7.4.280.0030.00316.62
7.4.270.0030.00316.52
7.4.260.0040.00413.30
7.4.250.0040.00416.59
7.4.240.0020.00616.62
7.4.230.0030.00316.36
7.4.220.0160.01016.52
7.4.210.0090.00716.62
7.4.200.0040.00416.65
7.4.190.0070.00016.75
7.4.160.0060.00916.40
7.4.150.0150.00317.40
7.4.140.0060.01517.86
7.4.130.0140.00316.58
7.4.120.0090.00916.49
7.4.110.0110.00716.55
7.4.100.0080.01216.48
7.4.90.0060.01016.51
7.4.80.0120.00919.39
7.4.70.0090.00916.54
7.4.60.0060.01016.55
7.4.50.0040.00416.27
7.4.40.0130.00322.77
7.4.30.0130.00616.57
7.4.00.0060.01214.77
7.3.330.0050.00013.24
7.3.320.0000.00513.24
7.3.310.0000.00716.20
7.3.300.0030.00316.36
7.3.290.0040.00916.28
7.3.280.0110.00516.30
7.3.270.0080.00917.40
7.3.260.0060.01016.43
7.3.250.0060.01116.53
7.3.240.0150.00316.53
7.3.230.0100.00716.41
7.3.210.0090.00916.64
7.3.200.0080.00819.39
7.3.190.0140.00816.52
7.3.180.0130.00316.57
7.3.170.0090.01216.38
7.3.160.0120.00616.54
7.3.120.0080.00414.59
7.3.110.0100.00714.81
7.3.100.0060.00615.00
7.3.90.0080.00014.81
7.3.80.0120.00014.77
7.3.70.0000.01214.62
7.3.60.0070.00714.91
7.3.50.0090.00614.94
7.3.40.0060.00614.61
7.3.30.0140.00314.87
7.3.20.0100.00616.42
7.3.10.0070.00816.61
7.3.00.0070.00716.69
7.2.330.0130.00716.57
7.2.320.0140.00316.57
7.2.310.0080.01516.72
7.2.300.0120.00416.87
7.2.290.0070.01016.61
7.2.240.0060.00915.05
7.2.230.0000.01114.96
7.2.220.0070.00715.34
7.2.210.0060.00314.77
7.2.200.0080.00815.14
7.2.190.0030.01314.83
7.2.180.0000.01314.85
7.2.170.0040.00715.24
7.2.160.0070.01015.21
7.2.150.0040.00817.16
7.2.140.0100.00716.81
7.2.130.0060.00816.92
7.2.120.0060.00916.84
7.2.110.0040.01116.94
7.2.100.0070.00616.84
7.2.90.0070.00816.83
7.2.80.0050.01016.81
7.2.70.0030.00717.02
7.2.60.0060.00917.03
7.2.50.0050.00917.05
7.2.40.0040.00816.93
7.2.30.0040.00916.90
7.2.20.0050.01016.89
7.2.10.0050.00816.95
7.2.00.0060.00817.56
7.1.330.0060.00615.82
7.1.320.0000.01515.91
7.1.310.0050.00315.90
7.1.300.0000.00816.00
7.1.290.0040.00715.86
7.1.280.0030.01316.02
7.1.270.0070.00716.02
7.1.260.0100.00716.05
7.1.250.0050.01015.77
7.1.100.0090.00018.05
7.1.70.0000.00717.19
7.1.60.0140.01019.32
7.1.50.0100.01016.87
7.1.00.0030.07022.35
7.0.200.0300.00714.78
7.0.140.0100.06722.09
7.0.60.0030.04719.81
7.0.50.0100.08017.88
7.0.40.0100.08320.30
7.0.30.0230.04320.10
7.0.20.0200.07020.24
7.0.10.0030.06320.12
7.0.00.0130.03320.34
5.6.280.0000.07721.02
5.6.210.0100.04320.55
5.6.200.0230.05018.25
5.6.190.0100.08320.48
5.6.180.0330.07020.39
5.6.170.0070.05020.50
5.6.160.0100.08020.54
5.6.150.0070.07018.16
5.6.140.0070.08018.26
5.6.130.0070.06718.17
5.6.120.0100.05021.00
5.6.110.0030.07321.02
5.6.100.0130.07721.20
5.6.90.0100.03720.98
5.6.80.0070.04020.52
5.5.350.0170.03320.36
5.5.340.0070.07717.95
5.5.330.0030.04320.27
5.5.320.0330.07320.34
5.5.310.0170.07320.23
5.5.300.0100.08017.95
5.5.290.0000.08718.08
5.5.280.0070.05320.88
5.5.270.0100.07720.84
5.5.260.0000.08720.98
5.5.250.0030.08320.62
5.5.240.0030.08020.30
5.4.450.0070.08319.64
5.4.440.0030.05719.32
5.4.430.0030.05719.40
5.4.420.0070.05319.18
5.4.410.0030.08019.14
5.4.400.0070.04319.07
5.4.390.0000.05318.99
5.4.380.0100.06319.08
5.4.370.0100.07719.13
5.4.360.0000.05718.99
5.4.350.0100.06318.96
5.4.340.0200.04018.87
5.4.320.0070.05019.18
5.4.310.0070.07319.22
5.4.300.0100.07019.09
5.4.290.0030.06018.95
5.4.280.0000.08019.30
5.4.270.0070.04019.22
5.4.260.0070.07019.09
5.4.250.0130.06719.18
5.4.240.0000.05019.08
5.4.230.0030.04018.93
5.4.220.0030.06719.22
5.4.210.0100.04319.22
5.4.200.0070.06019.21
5.4.190.0030.06718.86
5.4.180.0070.07719.23
5.4.170.0170.07719.18
5.4.160.0130.07719.07
5.4.150.0230.06319.06
5.4.140.0230.06716.40
5.4.130.0270.07016.36
5.4.120.0270.07316.55
5.4.110.0270.04016.50
5.4.100.0230.07316.61
5.4.90.0330.04316.39
5.4.80.0270.05316.59
5.4.70.0270.04016.41
5.4.60.0170.04716.54
5.4.50.0230.05016.51
5.4.40.0130.06716.16
5.4.30.0170.07016.55
5.4.20.0100.04016.25
5.4.10.0130.07016.43
5.4.00.0130.06015.94
5.3.290.0070.05714.64
5.3.280.0070.06014.52
5.3.270.0100.05014.77
5.3.260.0270.04714.71
5.3.250.0330.07314.60
5.3.240.0300.05714.66
5.3.230.0230.03314.53
5.3.220.0200.04314.52
5.3.210.0270.06314.60
5.3.200.0330.05014.66
5.3.190.0130.05314.47
5.3.180.0170.06314.49
5.3.170.0300.06714.73
5.3.160.0200.04014.47
5.3.150.0300.07014.59
5.3.140.0200.05014.46
5.3.130.0130.07314.61
5.3.120.0170.05014.62
5.3.110.0130.07314.47
5.3.100.0200.05714.16
5.3.90.0170.04713.99
5.3.80.0230.07313.93
5.3.70.0270.05014.14
5.3.60.0300.06714.08
5.3.50.0200.03713.96
5.3.40.0170.07314.11
5.3.30.0170.05013.94
5.3.20.0200.06713.79
5.3.10.0170.04713.78
5.3.00.0330.05313.73
5.2.170.0170.06012.39
5.2.160.0200.04712.39
5.2.150.0200.05012.39
5.2.140.0200.03312.39
5.2.130.0170.06012.39
5.2.120.0170.04712.39
5.2.110.0230.05012.39
5.2.100.0170.04712.39
5.2.90.0270.05012.39
5.2.80.0170.05712.39
5.2.70.0230.05312.39
5.2.60.0130.04312.39
5.2.50.0130.05712.39
5.2.40.0100.04012.39
5.2.30.0070.06312.39
5.2.20.0100.05712.39
5.2.10.0030.04312.39
5.2.00.0070.05012.39
5.1.60.0070.03712.39
5.1.50.0130.03312.39
5.1.40.0070.05012.39
5.1.30.0130.03712.39
5.1.20.0070.04712.39
5.1.10.0070.05012.39
5.1.00.0000.03312.39
5.0.50.0000.03012.39
5.0.40.0030.04712.39
5.0.30.0100.05312.39
5.0.20.0000.02712.39
5.0.10.0000.04312.39
5.0.00.0000.05012.39
4.4.90.0000.03012.39
4.4.80.0070.03012.39
4.4.70.0030.01712.39
4.4.60.0030.02312.39
4.4.50.0130.02312.39
4.4.40.0000.04312.39
4.4.30.0000.03312.39
4.4.20.0000.02312.39
4.4.10.0000.02012.39
4.4.00.0000.03712.39
4.3.110.0070.03312.39
4.3.100.0000.02712.39
4.3.90.0030.02312.39
4.3.80.0000.05312.39
4.3.70.0000.03312.39
4.3.60.0030.03312.39
4.3.50.0000.03312.39
4.3.40.0070.04712.39
4.3.30.0070.02312.39
4.3.20.0000.04012.39
4.3.10.0000.02012.39
4.3.00.0030.02312.39

preferences:
48.42 ms | 401 KiB | 5 Q