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('nvH*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.0100.00618.23
8.3.50.0050.01621.02
8.3.40.0110.00418.71
8.3.30.0040.01120.21
8.3.20.0050.00220.34
8.3.10.0040.00422.09
8.3.00.0000.00822.47
8.2.180.0110.01116.88
8.2.170.0100.01022.96
8.2.160.0120.00322.09
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00817.88
8.2.110.0000.00922.14
8.2.100.0030.00918.03
8.2.90.0040.00419.21
8.2.80.0000.00819.29
8.2.70.0000.00817.49
8.2.60.0060.00318.05
8.2.50.0080.00018.07
8.2.40.0080.00018.18
8.2.30.0030.00818.04
8.2.20.0000.00717.82
8.2.10.0000.00717.78
8.2.00.0050.00317.70
8.1.280.0150.00325.92
8.1.270.0100.00022.01
8.1.260.0040.00426.35
8.1.250.0080.00328.09
8.1.240.0070.00323.83
8.1.230.0080.00319.04
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0000.00917.34
8.1.190.0040.00417.53
8.1.180.0080.00019.01
8.1.170.0030.00518.54
8.1.160.0040.00420.92
8.1.150.0050.00318.58
8.1.140.0020.00517.52
8.1.130.0070.00017.77
8.1.120.0070.00017.46
8.1.110.0030.00517.52
8.1.100.0050.00317.38
8.1.90.0000.00817.40
8.1.80.0000.00717.40
8.1.70.0000.00817.44
8.1.60.0000.00817.50
8.1.50.0000.00717.53
8.1.40.0000.00717.56
8.1.30.0000.00917.59
8.1.20.0050.00317.58
8.1.10.0050.00317.50
8.1.00.0040.00417.55
8.0.300.0070.00018.77
8.0.290.0000.00717.18
8.0.280.0040.00418.48
8.0.270.0030.00317.28
8.0.260.0030.00316.91
8.0.250.0030.00316.94
8.0.240.0060.00317.02
8.0.230.0030.00316.89
8.0.220.0040.00416.92
8.0.210.0000.00716.97
8.0.200.0000.00716.96
8.0.190.0040.00417.05
8.0.180.0000.00716.92
8.0.170.0000.00717.03
8.0.160.0040.00416.87
8.0.150.0000.00916.80
8.0.140.0000.00716.85
8.0.130.0000.00513.43
8.0.120.0000.00816.92
8.0.110.0000.00816.88
8.0.100.0000.00817.04
8.0.90.0040.00416.98
8.0.80.0080.00816.86
8.0.70.0040.00416.90
8.0.60.0080.00016.89
8.0.50.0040.00416.99
8.0.30.0090.01017.17
8.0.20.0080.01217.40
8.0.10.0000.00817.11
8.0.00.0150.00516.89
7.4.330.0060.00015.00
7.4.320.0060.00016.51
7.4.300.0060.00016.55
7.4.290.0040.00716.48
7.4.280.0000.00716.52
7.4.270.0000.00716.50
7.4.260.0070.00316.59
7.4.250.0080.00016.49
7.4.240.0050.00216.52
7.4.230.0030.00316.62
7.4.220.0100.01716.62
7.4.210.0050.01116.56
7.4.200.0000.00816.52
7.4.190.0050.00216.79
7.4.160.0090.00616.43
7.4.150.0000.01817.40
7.4.140.0130.00617.86
7.4.130.0080.00816.53
7.4.120.0080.00816.54
7.4.110.0120.01216.40
7.4.100.0110.00716.36
7.4.90.0090.00916.75
7.4.80.0150.00319.39
7.4.70.0040.01216.49
7.4.60.0160.00316.52
7.4.50.0040.00416.61
7.4.40.0070.00722.77
7.4.30.0160.01016.54
7.4.00.0170.00014.93
7.3.330.0030.00313.43
7.3.320.0000.00613.46
7.3.310.0000.00716.46
7.3.300.0000.00716.37
7.3.290.0100.00316.36
7.3.280.0100.00616.38
7.3.270.0130.00317.40
7.3.260.0120.00416.70
7.3.250.0090.00916.49
7.3.240.0080.01616.66
7.3.230.0060.01316.39
7.3.210.0150.00916.52
7.3.200.0090.00919.39
7.3.190.0070.01716.51
7.3.180.0060.00916.44
7.3.170.0120.00416.68
7.3.160.0100.00716.47
7.3.120.0070.00715.14
7.3.10.0050.01016.57
7.3.00.0050.00816.67
7.2.330.0140.00316.64
7.2.320.0130.00916.75
7.2.310.0110.01216.81
7.2.300.0060.00916.87
7.2.290.0130.00616.86
7.2.130.0070.00517.04
7.2.120.0040.01216.91
7.2.110.0100.00716.93
7.2.100.0090.00516.98
7.2.90.0100.00317.15
7.2.80.0070.00716.79
7.2.70.0070.00916.57
7.2.60.0060.00516.99
7.2.50.0030.01316.86
7.2.40.0050.00816.90
7.2.30.0050.00717.14
7.2.20.0120.00316.96
7.2.10.0020.00916.88
7.2.00.0040.01117.83
7.1.250.0050.00615.60
7.1.100.0100.00018.46
7.1.70.0000.00817.01
7.1.60.0070.01719.32
7.1.50.0040.01816.72
7.1.00.0000.03722.48
7.0.200.0270.00314.75
7.0.140.0000.07721.93
7.0.100.0030.06019.95
7.0.90.0130.07320.03
7.0.80.0070.04720.00
7.0.70.0130.04719.88
7.0.60.0130.07720.10
7.0.50.0400.08320.36
7.0.40.0070.08020.20
7.0.30.0070.05020.15
7.0.20.0100.07320.15
7.0.10.0000.04320.10
7.0.00.0230.07320.10
5.6.280.0100.06721.05
5.6.250.0070.08320.83
5.6.240.0070.08320.68
5.6.230.0200.07020.61
5.6.220.0070.07320.70
5.6.210.0100.08020.57
5.6.200.0000.07321.07
5.6.190.0030.05721.12
5.6.180.0000.08720.99
5.6.170.0100.07321.06
5.6.160.0030.08021.10
5.6.150.0030.06321.06
5.6.140.0030.08020.93
5.6.130.0070.04720.95
5.6.120.0100.06021.03
5.6.110.0000.09321.05
5.6.100.0030.05321.02
5.6.90.0070.07321.03
5.6.80.0070.07320.49
5.6.70.0130.07320.46
5.6.60.0070.08020.46
5.6.50.0130.06720.35
5.6.40.0070.08020.39
5.6.30.0070.05720.45
5.6.20.0130.05020.50
5.6.10.0130.06320.39
5.6.00.0130.06320.43
5.5.380.0100.08020.41
5.5.370.0100.08320.43
5.5.360.0270.06020.35
5.5.350.0100.06320.38
5.5.340.0100.07720.90
5.5.330.0070.07720.91
5.5.320.0130.07020.90
5.5.310.0030.07320.84
5.5.300.0200.07020.81
5.5.290.0030.05320.90
5.5.280.0100.08020.85
5.5.270.0100.08020.89
5.5.260.0070.07720.88
5.5.250.0070.08020.70
5.5.240.0100.07320.29
5.5.230.0070.07320.29
5.5.220.0030.08020.22
5.5.210.0070.04320.15
5.5.200.0000.08020.28
5.5.190.0070.07320.27
5.5.180.0070.07320.20
5.5.160.0030.08020.24
5.5.150.0000.08320.00
5.5.140.0070.05020.27
5.5.130.0100.06320.20
5.5.120.0100.07720.28
5.5.110.0100.07320.16
5.5.100.0070.07020.15
5.5.90.0070.08020.14
5.5.80.0070.06320.09
5.5.70.0000.07320.14
5.5.60.0030.04020.15
5.5.50.0130.04019.95
5.5.40.0030.04019.94
5.5.30.0100.03320.06
5.5.20.0000.04320.10
5.5.10.0030.03719.99
5.5.00.0070.03720.12
5.4.450.0000.04719.46
5.4.440.0070.08019.38
5.4.430.0070.08019.41
5.4.420.0070.07019.45
5.4.410.0100.07019.20
5.4.400.0070.03319.10
5.4.390.0030.07719.03
5.4.380.0130.06319.20
5.4.370.0100.06718.95
5.4.360.0100.08019.05
5.4.350.0070.07319.18
5.4.340.0070.04719.23
5.4.320.0030.10319.05
5.4.310.0100.04019.14
5.4.300.0070.08019.16
5.4.290.0070.08018.90
5.4.280.0030.08019.12
5.4.270.0070.06018.96
5.4.260.0030.08018.88
5.4.250.0130.06319.15
5.4.240.0030.08019.18
5.4.230.0030.04019.23
5.4.220.0070.05318.88
5.4.210.0100.05019.18
5.4.200.0030.05319.05
5.4.190.0000.04019.09
5.4.180.0000.04018.95
5.4.170.0030.04019.23
5.4.160.0030.03319.22
5.4.150.0070.03318.84
5.4.140.0100.03016.47
5.4.130.0030.03716.48
5.4.120.0000.04016.48
5.4.110.0000.04016.49
5.4.100.0000.03716.45
5.4.90.0070.03016.42
5.4.80.0030.03316.51
5.4.70.0030.02716.47
5.4.60.0000.03716.45
5.4.50.0100.02316.33
5.4.40.0030.05316.30
5.4.30.0030.06716.31
5.4.20.0000.03716.41
5.4.10.0000.03316.48
5.4.00.0030.06015.95
5.3.290.0030.07714.80
5.3.280.0070.03714.61
5.3.270.0030.04014.60
5.3.260.0030.03714.61
5.3.250.0070.03314.76
5.3.240.0030.03714.72
5.3.230.0030.03314.65
5.3.220.0030.04014.57
5.3.210.0130.02714.68
5.3.200.0030.05314.64
5.3.190.0070.03014.61
5.3.180.0130.04314.54
5.3.170.0030.05014.60
5.3.160.0130.02314.59
5.3.150.0000.03314.51
5.3.140.0000.03714.64
5.3.130.0000.04014.63
5.3.120.0070.03714.70
5.3.110.0000.04314.52
5.3.100.0100.03314.13
5.3.90.0000.03313.97
5.3.80.0100.02314.03
5.3.70.0070.04014.15
5.3.60.0030.03714.09
5.3.50.0000.04013.95
5.3.40.0000.04014.07
5.3.30.0030.03313.91
5.3.20.0000.04013.69
5.3.10.0000.03713.70
5.3.00.0000.03713.78
5.2.170.0000.03011.18
5.2.160.0000.03011.21
5.2.150.0070.02711.07
5.2.140.0070.04711.07
5.2.130.0030.02711.18
5.2.120.0000.03011.06
5.2.110.0000.03311.11
5.2.100.0070.02310.98
5.2.90.0000.03011.04
5.2.80.0100.02711.18
5.2.70.0000.03011.12
5.2.60.0070.02310.98
5.2.50.0030.02710.99
5.2.40.0030.03711.03
5.2.30.0070.02310.89
5.2.20.0030.03711.11
5.2.10.0030.02710.93
5.2.00.0000.03010.89
5.1.60.0030.03010.89
5.1.50.0000.03710.89
5.1.40.0030.03310.89
5.1.30.0000.03310.89
5.1.20.0030.05710.89
5.1.10.0000.02710.89
5.1.00.0000.05310.89
5.0.50.0030.04010.89
5.0.40.0000.04710.89
5.0.30.0070.05710.89
5.0.20.0030.04310.89
5.0.10.0030.04010.89
5.0.00.0030.06710.89
4.4.90.0070.02710.89
4.4.80.0030.01310.89
4.4.70.0000.02310.89
4.4.60.0070.01010.89
4.4.50.0070.02310.89
4.4.40.0000.04310.89
4.4.30.0000.01710.89
4.4.20.0000.02310.89
4.4.10.0030.02710.89
4.4.00.0030.05310.89
4.3.110.0100.03010.89
4.3.100.0070.03010.89
4.3.90.0070.03010.89
4.3.80.0030.04010.89
4.3.70.0000.03310.89
4.3.60.0070.03010.89
4.3.50.0100.01310.89
4.3.40.0070.04710.89
4.3.30.0000.03310.89
4.3.20.0000.03710.89
4.3.10.0030.03310.89
4.3.00.0030.03310.89

preferences:
52.68 ms | 401 KiB | 5 Q