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*', $testParts[0], $testParts[1], $testParts[2], $testParts[3], $testParts[4], $testParts[5], $testParts[6], $testParts[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.0060.00918.56
8.3.50.0110.01021.86
8.3.40.0060.00918.82
8.3.30.0140.00720.26
8.3.20.0070.00020.14
8.3.10.0080.00022.09
8.3.00.0080.00022.52
8.2.180.0180.00416.63
8.2.170.0170.00322.96
8.2.160.0100.00322.08
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0110.00326.16
8.2.120.0040.00417.75
8.2.110.0090.00022.29
8.2.100.0080.00317.84
8.2.90.0000.00819.17
8.2.80.0000.00719.40
8.2.70.0060.00317.50
8.2.60.0030.00618.05
8.2.50.0030.00618.07
8.2.40.0000.00818.28
8.2.30.0110.00018.08
8.2.20.0000.00817.65
8.2.10.0000.00817.76
8.2.00.0000.00817.72
8.1.280.0070.00725.92
8.1.270.0090.00324.66
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0080.00023.83
8.1.230.0030.00919.07
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0030.00517.39
8.1.180.0030.00518.76
8.1.170.0050.00318.48
8.1.160.0030.00320.82
8.1.150.0040.00418.66
8.1.140.0030.00517.47
8.1.130.0040.00417.91
8.1.120.0040.00417.47
8.1.110.0030.00517.55
8.1.100.0000.00817.36
8.1.90.0030.00317.52
8.1.80.0000.00717.38
8.1.70.0000.00717.41
8.1.60.0050.00317.63
8.1.50.0070.00017.53
8.1.40.0030.00617.37
8.1.30.0070.00017.56
8.1.20.0030.00617.71
8.1.10.0000.00817.51
8.1.00.0000.00817.55
8.0.300.0000.00718.77
8.0.290.0000.00717.04
8.0.280.0040.00418.51
8.0.270.0000.00817.33
8.0.260.0000.00616.81
8.0.250.0070.00016.96
8.0.240.0080.00017.05
8.0.230.0000.00717.00
8.0.220.0000.00716.93
8.0.210.0030.00316.96
8.0.200.0000.00716.94
8.0.190.0060.00316.98
8.0.180.0000.00817.03
8.0.170.0060.00317.01
8.0.160.0070.00016.91
8.0.150.0000.00716.98
8.0.140.0030.00316.84
8.0.130.0000.00513.39
8.0.120.0000.00816.81
8.0.110.0040.00416.81
8.0.100.0040.00416.94
8.0.90.0040.00416.84
8.0.80.0100.00917.00
8.0.70.0030.00316.97
8.0.60.0040.00416.97
8.0.50.0000.00716.99
8.0.30.0060.01417.06
8.0.20.0100.00817.40
8.0.10.0000.00817.01
8.0.00.0130.00716.85
7.4.330.0060.00015.00
7.4.320.0030.00316.57
7.4.300.0030.00316.59
7.4.290.0040.00416.68
7.4.280.0030.00316.66
7.4.270.0070.00016.54
7.4.260.0050.00316.60
7.4.250.0030.00316.61
7.4.240.0040.00416.60
7.4.230.0030.00316.63
7.4.220.0070.01116.51
7.4.210.0090.00716.63
7.4.200.0000.00716.43
7.4.190.0000.00716.61
7.4.160.0000.01616.60
7.4.150.0090.00917.40
7.4.140.0120.00717.86
7.4.130.0070.01016.45
7.4.120.0170.00316.58
7.4.110.0120.01516.43
7.4.100.0180.00016.55
7.4.90.0090.00916.61
7.4.80.0070.01419.39
7.4.70.0100.01016.42
7.4.60.0030.01716.44
7.4.50.0040.00416.50
7.4.40.0070.01022.77
7.4.30.0060.01716.52
7.4.10.0120.00615.16
7.4.00.0090.00915.12
7.3.330.0020.00213.27
7.3.320.0030.00313.21
7.3.310.0000.00716.48
7.3.300.0000.00716.36
7.3.290.0120.00816.39
7.3.280.0090.01116.36
7.3.270.0060.01117.40
7.3.260.0190.00016.49
7.3.250.0070.01216.45
7.3.240.0100.00716.48
7.3.230.0160.00016.43
7.3.210.0130.00316.56
7.3.200.0060.01119.39
7.3.190.0070.01416.50
7.3.180.0200.01816.52
7.3.170.0130.00316.43
7.3.160.0110.00616.55
7.3.130.0070.01115.02
7.3.120.0090.00814.73
7.3.110.0100.00514.77
7.3.100.0090.00514.95
7.3.90.0090.00514.84
7.3.80.0080.00514.65
7.3.70.0050.00815.02
7.3.60.0040.01114.95
7.3.50.0070.01014.82
7.3.40.0050.00814.87
7.3.30.0080.00414.76
7.3.20.0050.00816.68
7.3.10.0020.01216.88
7.3.00.0060.00816.74
7.2.330.0060.01216.44
7.2.320.0060.01216.58
7.2.310.0130.00416.80
7.2.300.0140.01016.41
7.2.290.0100.01016.54
7.2.260.0070.01415.34
7.2.250.0070.01115.30
7.2.240.0090.00615.10
7.2.230.0130.00315.03
7.2.220.0080.00915.27
7.2.210.0080.00615.10
7.2.200.0030.00915.07
7.2.190.0040.00714.92
7.2.180.0050.00515.12
7.2.170.0000.01215.06
7.2.160.0140.00314.96
7.2.150.0040.00816.67
7.2.140.0070.00716.89
7.2.130.0000.01017.08
7.2.120.0030.01217.13
7.2.110.0000.00916.97
7.2.100.0060.00316.89
7.2.90.0040.01016.93
7.2.80.0090.00617.16
7.2.70.0030.00716.95
7.2.60.0070.00316.94
7.2.50.0080.00417.09
7.2.40.0090.00616.93
7.2.30.0030.00616.93
7.2.20.0030.01217.03
7.2.10.0110.00416.95
7.2.00.0040.00716.82
7.1.330.0050.00915.94
7.1.320.0030.01015.96
7.1.310.0080.00615.89
7.1.300.0030.01015.86
7.1.290.0040.01115.78
7.1.280.0060.00615.73
7.1.270.0050.00815.73
7.1.260.0060.00615.69
7.1.250.0090.00315.79
7.1.240.0100.00315.84
7.1.230.0000.01315.54
7.1.220.0040.00415.84
7.1.210.0030.00915.47
7.1.200.0050.00815.81
7.1.190.0040.00715.75
7.1.180.0000.01315.91
7.1.170.0090.00315.75
7.1.160.0000.01415.64
7.1.150.0070.00315.86
7.1.140.0040.01215.93
7.1.130.0070.00715.89
7.1.120.0040.00715.67
7.1.110.0070.00715.65
7.1.100.0070.00415.96
7.1.90.0030.01015.71
7.1.80.0060.00615.72
7.1.70.0020.00816.60
7.1.60.0070.01317.37
7.1.50.0070.01016.35
7.1.40.0040.01115.86
7.1.30.0030.00615.77
7.1.20.0110.00415.77
7.1.10.0100.00315.91
7.1.00.0000.02519.11
7.0.330.0130.00315.30
7.0.320.0000.01015.39
7.0.310.0100.00315.26
7.0.300.0030.00915.18
7.0.290.0030.01415.35
7.0.280.0080.00015.24
7.0.270.0040.00415.45
7.0.260.0090.00615.21
7.0.250.0070.00715.29
7.0.240.0040.00715.58
7.0.230.0000.01415.39
7.0.220.0090.00415.34
7.0.210.0000.01715.48
7.0.200.0020.00915.14
7.0.190.0070.00715.46
7.0.180.0070.00715.59
7.0.170.0040.01215.50
7.0.160.0040.00815.24
7.0.150.0100.00315.43
7.0.140.0060.03618.77
7.0.130.0090.00615.37
7.0.120.0070.00715.36
7.0.110.0090.00615.32
7.0.100.0090.02717.74
7.0.90.0050.04617.78
7.0.80.0160.02517.62
7.0.70.0150.02417.69
7.0.60.0090.03417.70
7.0.50.0030.05018.01
7.0.40.0030.02616.80
7.0.30.0050.03316.88
7.0.20.0070.02716.73
7.0.10.0030.03016.83
7.0.00.0080.04016.75
5.6.400.0000.00814.53
5.6.390.0000.01214.15
5.6.380.0030.01214.28
5.6.370.0120.00413.86
5.6.360.0000.01514.46
5.6.350.0040.01213.82
5.6.340.0070.00314.38
5.6.330.0060.00613.99
5.6.320.0040.01113.83
5.6.310.0090.00014.13
5.6.300.0030.00614.71
5.6.290.0030.00914.53
5.6.280.0050.03817.74
5.6.270.0060.00314.16
5.6.260.0050.00514.55
5.6.250.0070.02717.37
5.6.240.0070.02417.59
5.6.230.0110.04117.63
5.6.220.0060.04317.46
5.6.210.0030.04217.53
5.6.200.0080.03917.68
5.6.190.0040.05117.52
5.6.180.0100.04017.91
5.6.170.0020.02917.77
5.6.160.0050.03917.50
5.6.150.0050.04417.53
5.6.140.0050.03517.81
5.6.130.0080.03517.69
5.6.120.0070.02517.75
5.6.110.0030.04017.64
5.6.100.0050.04717.75
5.6.90.0070.03017.76
5.6.80.0050.02517.28
5.6.70.0070.03217.37
5.6.60.0070.04317.46
5.6.50.0050.02717.13
5.6.40.0090.02917.25
5.6.30.0130.02417.30
5.6.20.0090.02617.39
5.6.10.0030.02417.29
5.6.00.0070.02017.39
5.5.380.0070.03817.42
5.5.370.0120.03317.26
5.5.360.0020.02717.24
5.5.350.0070.04417.37
5.5.340.0070.02817.57
5.5.330.0070.04817.65
5.5.320.0080.03517.59
5.5.310.0030.03017.29
5.5.300.0030.03517.46
5.5.290.0080.02317.58
5.5.280.0030.03917.74
5.5.270.0080.03917.45
5.5.260.0060.04317.51
5.5.250.0050.04717.46
5.5.240.0070.03717.09
5.5.230.0070.03717.26
5.5.220.0050.04117.35
5.5.210.0030.04717.23
5.5.200.0120.04017.23
5.5.190.0090.03217.31
5.5.180.0080.04417.24
5.5.170.0030.01014.24
5.5.160.0060.02317.13
5.5.150.0100.04017.06
5.5.140.0020.03217.13
5.5.130.0100.03817.24
5.5.120.0050.02717.12
5.5.110.0100.03417.05
5.5.100.0100.03817.21
5.5.90.0030.02417.23
5.5.80.0090.04517.10
5.5.70.0100.02717.27
5.5.60.0070.03717.13
5.5.50.0090.02117.12
5.5.40.0090.02817.24
5.5.30.0020.02417.25
5.5.20.0080.04216.92
5.5.10.0020.03717.14
5.5.00.0100.04716.99
5.4.450.0170.01515.39
5.4.440.0050.02215.27
5.4.430.0020.03515.26
5.4.420.0030.02415.48
5.4.410.0070.03815.10
5.4.400.0030.03115.11
5.4.390.0100.03715.04
5.4.380.0090.02215.11
5.4.370.0080.04015.06
5.4.360.0030.04015.12
5.4.350.0060.03915.10
5.4.340.0080.03715.07
5.4.330.0000.00710.92
5.4.320.0070.02015.02
5.4.310.0030.02315.12
5.4.300.0070.04214.91
5.4.290.0090.04315.10
5.4.280.0080.03915.13
5.4.270.0080.03215.11
5.4.260.0020.02915.04
5.4.250.0050.02015.01
5.4.240.0070.03214.98
5.4.230.0060.04115.21
5.4.220.0030.02514.95
5.4.210.0050.04115.01
5.4.200.0050.02515.17
5.4.190.0080.03515.03
5.4.180.0050.04015.02
5.4.170.0020.02915.03
5.4.160.0050.04214.97
5.4.150.0030.02314.85
5.4.140.0030.04113.80
5.4.130.0060.03113.77
5.4.120.0090.03513.63
5.4.110.0060.02813.93
5.4.100.0020.03013.68
5.4.90.0050.04013.77
5.4.80.0020.04113.76
5.4.70.0050.04113.70
5.4.60.0020.02813.91
5.4.50.0060.03513.73
5.4.40.0050.02113.88
5.4.30.0050.02513.72
5.4.20.0050.02013.80
5.4.10.0090.02013.78
5.4.00.0020.02513.56
5.3.290.0060.03912.76
5.3.280.0010.03812.72
5.3.270.0050.02912.77
5.3.260.0100.03512.77
5.3.250.0080.03712.80
5.3.240.0030.03812.73
5.3.230.0040.03212.79
5.3.220.0050.04312.77
5.3.210.0120.03312.70
5.3.200.0030.03912.75
5.3.190.0050.02312.75
5.3.180.0050.04312.70
5.3.170.0020.02812.71
5.3.160.0030.04112.75
5.3.150.0060.03412.73
5.3.140.0060.03512.70
5.3.130.0010.03612.71
5.3.120.0050.03912.74
5.3.110.0050.04112.71
5.3.100.0070.03312.50
5.3.90.0090.02012.44
5.3.80.0030.04112.39
5.3.70.0060.03412.49
5.3.60.0050.01812.44
5.3.50.0060.03712.41
5.3.40.0090.04112.36
5.3.30.0040.03812.42
5.3.20.0040.02612.34
5.3.10.0050.02512.32
5.3.00.0070.03012.32
5.2.170.0000.06713.24
5.2.160.0100.05713.24
5.2.150.0070.03713.24
5.2.140.0030.03013.24
5.2.130.0030.03013.24
5.2.120.0030.05313.24
5.2.110.0070.06313.24
5.2.100.0100.04713.24
5.2.90.0000.06313.24
5.2.80.0030.04313.24
5.2.70.0030.03313.24
5.2.60.0030.05013.24
5.2.50.0030.03313.24
5.2.40.0100.04013.24
5.2.30.0070.03013.24
5.2.20.0070.03013.24
5.2.10.0000.05013.24
5.2.00.0070.05313.24
5.1.60.0030.04013.24
5.1.50.0000.04713.24
5.1.40.0000.03013.24
5.1.30.0070.05313.24
5.1.20.0130.05313.24
5.1.10.0030.05313.24
5.1.00.0070.04313.24
5.0.50.0030.03713.24
5.0.40.0000.02013.24
5.0.30.0030.05713.24
5.0.20.0000.02713.24
5.0.10.0030.03313.24
5.0.00.0000.06713.24
4.4.90.0000.03313.24
4.4.80.0000.03713.24
4.4.70.0070.02313.24
4.4.60.0000.02313.24
4.4.50.0000.03713.24
4.4.40.0030.04013.24
4.4.30.0000.02013.24
4.4.20.0030.03013.24
4.4.10.0030.03313.24
4.4.00.0070.02313.24
4.3.110.0000.02013.24
4.3.100.0030.03313.24
4.3.90.0000.03313.24
4.3.80.0000.05713.24
4.3.70.0000.02713.24
4.3.60.0000.02713.24
4.3.50.0030.03313.24
4.3.40.0170.01713.24
4.3.30.0030.03313.24
4.3.20.0000.03013.24
4.3.10.0000.02713.24
4.3.00.0000.03313.24

preferences:
43.46 ms | 401 KiB | 5 Q