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('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.43
8.3.50.0130.00821.14
8.3.40.0070.01118.97
8.3.30.0100.01020.33
8.3.20.0040.00420.34
8.3.10.0030.00622.02
8.3.00.0050.00322.52
8.2.180.0070.01016.50
8.2.170.0070.00722.96
8.2.160.0100.00322.08
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.01126.16
8.2.120.0080.00019.48
8.2.110.0030.00620.93
8.2.100.0040.00817.91
8.2.90.0050.00317.75
8.2.80.0040.00418.70
8.2.70.0000.00817.75
8.2.60.0000.00817.63
8.2.50.0060.00318.04
8.2.40.0030.00520.01
8.2.30.0050.00318.15
8.2.20.0000.00717.68
8.2.10.0000.00717.80
8.2.00.0040.00417.64
8.1.280.0090.00925.92
8.1.270.0070.00024.66
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0060.00320.83
8.1.230.0080.00319.05
8.1.220.0050.00318.55
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0110.00417.25
8.1.180.0070.00318.10
8.1.170.0030.00617.62
8.1.160.0050.00218.82
8.1.150.0020.00518.58
8.1.140.0040.00417.39
8.1.130.0050.00217.86
8.1.120.0040.00417.46
8.1.110.0080.00017.40
8.1.100.0100.00017.50
8.1.90.0030.00317.50
8.1.80.0000.00717.39
8.1.70.0030.00317.37
8.1.60.0060.00317.59
8.1.50.0040.00417.57
8.1.40.0000.00817.54
8.1.30.0030.00617.66
8.1.20.0040.00417.74
8.1.10.0040.00417.64
8.1.00.0030.00617.47
8.0.300.0020.00518.77
8.0.290.0040.00416.75
8.0.280.0070.00018.43
8.0.270.0070.00017.40
8.0.260.0070.00016.87
8.0.250.0000.00716.98
8.0.240.0000.00817.07
8.0.230.0000.00716.98
8.0.220.0000.00717.00
8.0.210.0070.00016.98
8.0.200.0040.00417.05
8.0.190.0030.00516.94
8.0.180.0000.01016.96
8.0.170.0050.00317.00
8.0.160.0050.00216.94
8.0.150.0000.00816.86
8.0.140.0000.00816.84
8.0.130.0030.00313.41
8.0.120.0050.00316.91
8.0.110.0000.00717.02
8.0.100.0000.00717.00
8.0.90.0070.00016.88
8.0.80.0110.00816.95
8.0.70.0000.00717.00
8.0.60.0000.00716.98
8.0.50.0000.00716.93
8.0.30.0170.00517.13
8.0.20.0070.01117.40
8.0.10.0040.00417.12
8.0.00.0090.01016.91
7.4.330.0000.00515.12
7.4.320.0000.00616.51
7.4.300.0000.00616.67
7.4.290.0030.00616.44
7.4.280.0030.00316.44
7.4.270.0000.00716.49
7.4.260.0000.00813.27
7.4.250.0000.00816.45
7.4.240.0020.00616.64
7.4.230.0000.00716.55
7.4.220.0070.01116.70
7.4.210.0100.00516.60
7.4.200.0040.00416.37
7.4.190.0000.00716.42
7.4.160.0090.00616.70
7.4.150.0100.01017.40
7.4.140.0080.00917.86
7.4.130.0120.00516.64
7.4.120.0160.00516.54
7.4.110.0180.00616.45
7.4.100.0130.00416.62
7.4.90.0030.01516.65
7.4.80.0100.00719.39
7.4.70.0050.01116.39
7.4.60.0130.00416.25
7.4.50.0090.00016.54
7.4.40.0030.01022.77
7.4.30.0040.01616.62
7.4.10.0120.00614.85
7.4.00.0070.00714.85
7.3.330.0030.00313.47
7.3.320.0000.00513.32
7.3.310.0000.00816.50
7.3.300.0030.00316.33
7.3.290.0000.01616.36
7.3.280.0080.00916.43
7.3.270.0100.00717.40
7.3.260.0060.01316.54
7.3.250.0130.00816.53
7.3.240.0090.00916.61
7.3.230.0100.01016.44
7.3.210.0130.00716.32
7.3.200.0100.00619.39
7.3.190.0100.01316.47
7.3.180.0070.01016.46
7.3.170.0140.00916.59
7.3.160.0030.01216.69
7.3.130.0060.01314.87
7.3.120.0050.01114.99
7.3.110.0030.01715.04
7.3.100.0030.00914.77
7.3.90.0070.01015.11
7.3.80.0110.00014.83
7.3.70.0060.00914.57
7.3.60.0060.00614.81
7.3.50.0060.00314.88
7.3.40.0090.00314.74
7.3.30.0080.00414.68
7.3.20.0060.00616.52
7.3.10.0090.00316.71
7.3.00.0090.00516.62
7.2.330.0140.00716.48
7.2.320.0040.01516.79
7.2.310.0030.01316.90
7.2.300.0120.00916.43
7.2.290.0090.00916.87
7.2.260.0030.01715.06
7.2.250.0040.01514.79
7.2.240.0130.00315.27
7.2.230.0120.00315.32
7.2.220.0070.01114.82
7.2.210.0000.01314.98
7.2.200.0080.00815.06
7.2.190.0030.01014.79
7.2.180.0040.00714.92
7.2.170.0080.00615.07
7.2.160.0030.01414.69
7.2.150.0000.01017.03
7.2.140.0100.00316.60
7.2.130.0070.00416.90
7.2.120.0050.00916.90
7.2.110.0060.00716.74
7.2.100.0030.01016.77
7.2.90.0020.01216.85
7.2.80.0060.00517.02
7.2.70.0050.00816.90
7.2.60.0020.01217.11
7.2.50.0020.01017.04
7.2.40.0020.01216.99
7.2.30.0050.00516.99
7.2.20.0080.00516.88
7.2.10.0090.00616.88
7.2.00.0020.01316.95
7.1.330.0060.00815.82
7.1.320.0070.00315.54
7.1.310.0080.00815.77
7.1.300.0070.00716.00
7.1.290.0070.00315.95
7.1.280.0100.00315.93
7.1.270.0000.00915.96
7.1.260.0080.00615.93
7.1.250.0020.01115.77
7.1.240.0030.01015.79
7.1.230.0040.01115.98
7.1.220.0000.01115.85
7.1.210.0030.00915.69
7.1.200.0000.01215.88
7.1.190.0090.00315.82
7.1.180.0070.00715.74
7.1.170.0030.00715.75
7.1.160.0000.01415.60
7.1.150.0030.01015.67
7.1.140.0000.01815.89
7.1.130.0120.00615.78
7.1.120.0100.00315.77
7.1.110.0060.00915.50
7.1.100.0060.00915.62
7.1.90.0030.01015.56
7.1.80.0090.00015.93
7.1.70.0040.00716.67
7.1.60.0100.01017.45
7.1.50.0060.00716.31
7.1.40.0000.00815.81
7.1.30.0070.00315.89
7.1.20.0050.00515.81
7.1.10.0030.01315.63
7.1.00.0000.02319.05
7.0.330.0080.00415.39
7.0.320.0090.00315.51
7.0.310.0060.00615.41
7.0.300.0030.00915.36
7.0.290.0040.00415.44
7.0.280.0040.00815.28
7.0.270.0130.00315.41
7.0.260.0030.00815.57
7.0.250.0100.00315.60
7.0.240.0070.00415.39
7.0.230.0070.00715.59
7.0.220.0060.00615.52
7.0.210.0100.00315.16
7.0.200.0090.00415.00
7.0.190.0060.00915.49
7.0.180.0050.00515.55
7.0.170.0000.00915.12
7.0.160.0070.00715.09
7.0.150.0050.00515.27
7.0.140.0050.04018.67
7.0.130.0100.00615.20
7.0.120.0030.01015.62
7.0.110.0080.00615.16
7.0.100.0260.04017.74
7.0.90.0030.04617.63
7.0.80.0050.04117.68
7.0.70.0050.04017.70
7.0.60.0000.04817.58
7.0.50.0080.03818.00
7.0.40.0120.04016.79
7.0.30.0030.04616.82
7.0.20.0030.04416.74
7.0.10.0070.04216.71
7.0.00.0050.04216.74
5.6.400.0030.00914.65
5.6.390.0030.01014.34
5.6.380.0000.01114.55
5.6.370.0150.00014.14
5.6.360.0000.01514.59
5.6.350.0060.00914.66
5.6.340.0030.00914.52
5.6.330.0060.01214.45
5.6.320.0150.00014.38
5.6.310.0090.00614.46
5.6.300.0040.01214.52
5.6.290.0030.00614.38
5.6.280.0070.03817.69
5.6.270.0100.00314.36
5.6.260.0060.00314.30
5.6.250.0070.04517.53
5.6.240.0080.04517.47
5.6.230.0120.03717.49
5.6.220.0050.03517.49
5.6.210.0080.04117.60
5.6.200.0070.04517.67
5.6.190.0120.03017.71
5.6.180.0050.04417.84
5.6.170.0120.04217.59
5.6.160.0110.04017.69
5.6.150.0070.04517.77
5.6.140.0080.04317.61
5.6.130.0080.04117.67
5.6.120.0090.04917.69
5.6.110.0080.04217.51
5.6.100.0070.04217.67
5.6.90.0050.04417.65
5.6.80.0110.03717.28
5.6.70.0070.04117.34
5.6.60.0100.04317.33
5.6.50.0050.03017.31
5.6.40.0020.04517.26
5.6.30.0100.04017.46
5.6.20.0050.04017.41
5.6.10.0050.04717.38
5.6.00.0070.04317.33
5.5.380.0120.04017.31
5.5.370.0130.03517.21
5.5.360.0070.04117.11
5.5.350.0080.04217.34
5.5.340.0050.03317.57
5.5.330.0100.04117.50
5.5.320.0090.02517.53
5.5.310.0130.04317.47
5.5.300.0110.03517.37
5.5.290.0080.04617.61
5.5.280.0070.04517.69
5.5.270.0020.04617.50
5.5.260.0060.02917.56
5.5.250.0080.04517.48
5.5.240.0050.04317.23
5.5.230.0080.04517.03
5.5.220.0080.04217.16
5.5.210.0070.04117.29
5.5.200.0050.04017.33
5.5.190.0060.03317.30
5.5.180.0050.04217.35
5.5.170.0030.00914.15
5.5.160.0120.03317.20
5.5.150.0070.03517.29
5.5.140.0100.03817.30
5.5.130.0110.03817.28
5.5.120.0150.02217.24
5.5.110.0040.03417.27
5.5.100.0070.04117.13
5.5.90.0080.03917.18
5.5.80.0030.04517.21
5.5.70.0030.02717.07
5.5.60.0050.03717.10
5.5.50.0080.04317.15
5.5.40.0050.04417.09
5.5.30.0050.03717.06
5.5.20.0030.02517.08
5.5.10.0010.04917.08
5.5.00.0120.03617.12
5.4.450.0050.04315.77
5.4.440.0030.03215.91
5.4.430.0090.04515.79
5.4.420.0120.03215.88
5.4.410.0080.04215.85
5.4.400.0070.04515.63
5.4.390.0020.03815.70
5.4.380.0090.02615.61
5.4.370.0030.02915.70
5.4.360.0030.03515.77
5.4.350.0030.02615.63
5.4.340.0020.04315.70
5.4.330.0040.00412.36
5.4.320.0100.03515.75
5.4.310.0060.04015.70
5.4.300.0030.04115.71
5.4.290.0050.04715.70
5.4.280.0050.03915.79
5.4.270.0100.02815.79
5.4.260.0090.04015.69
5.4.250.0070.02115.65
5.4.240.0070.03115.74
5.4.230.0050.04115.70
5.4.220.0110.02015.75
5.4.210.0020.04315.61
5.4.200.0020.04415.62
5.4.190.0020.03015.75
5.4.180.0080.03515.74
5.4.170.0030.03715.65
5.4.160.0110.03815.73
5.4.150.0060.04115.61
5.4.140.0030.04314.34
5.4.130.0050.03914.41
5.4.120.0050.03014.37
5.4.110.0030.04014.44
5.4.100.0020.04514.46
5.4.90.0050.03714.37
5.4.80.0050.04214.45
5.4.70.0070.04314.37
5.4.60.0000.04414.42
5.4.50.0100.01814.42
5.4.40.0080.03514.44
5.4.30.0030.03714.40
5.4.20.0010.03814.36
5.4.10.0050.03214.40
5.4.00.0040.04014.07
5.3.290.0050.04213.50
5.3.280.0130.03513.45
5.3.270.0070.04013.53
5.3.260.0050.02013.54
5.3.250.0120.03313.53
5.3.240.0100.02513.52
5.3.230.0050.04013.54
5.3.220.0090.04013.46
5.3.210.0090.03713.49
5.3.200.0090.02113.51
5.3.190.0090.03013.54
5.3.180.0080.03513.47
5.3.170.0050.03813.47
5.3.160.0070.03713.54
5.3.150.0020.03713.47
5.3.140.0050.02313.45
5.3.130.0070.03013.45
5.3.120.0050.02513.53
5.3.110.0030.03213.47
5.3.100.0040.02913.19
5.3.90.0080.02613.16
5.3.80.0050.04313.19
5.3.70.0060.04013.23
5.3.60.0100.02513.18
5.3.50.0040.02313.17
5.3.40.0050.03513.21
5.3.30.0070.03113.09
5.3.20.0080.03713.05
5.3.10.0100.03713.01
5.3.00.0070.03013.00
5.2.170.0000.06711.06
5.2.160.0130.05711.14
5.2.150.0000.05311.18
5.2.140.0030.06711.22
5.2.130.0070.06011.00
5.2.120.0070.05711.14
5.2.110.0030.05711.06
5.2.100.0030.05311.12
5.2.90.0000.06011.05
5.2.80.0030.06711.13
5.2.70.0000.07011.10
5.2.60.0100.06311.09
5.2.50.0030.06711.04
5.2.40.0100.05310.92
5.2.30.0070.05711.04
5.2.20.0070.05710.88
5.2.10.0070.04010.80
5.2.00.0000.07010.79
5.1.60.0100.05010.03
5.1.50.0070.05310.00
5.1.40.0070.0509.98
5.1.30.0000.05310.41
5.1.20.0070.04710.51
5.1.10.0030.06310.15
5.1.00.0070.0509.98
5.0.50.0070.0438.41
5.0.40.0130.0338.42
5.0.30.0070.0638.41
5.0.20.0000.0478.41
5.0.10.0100.0408.41
5.0.00.0070.0608.41
4.4.90.0000.0408.41
4.4.80.0030.0378.41
4.4.70.0030.0378.41
4.4.60.0000.0278.41
4.4.50.0030.0338.41
4.4.40.0030.0538.41
4.4.30.0070.0338.41
4.4.20.0030.0338.41
4.4.10.0000.0408.41
4.4.00.0000.0278.41
4.3.110.0000.0338.41
4.3.100.0030.0378.41
4.3.90.0030.0338.41
4.3.80.0070.0408.41
4.3.70.0030.0238.41
4.3.60.0030.0338.41
4.3.50.0070.0308.41
4.3.40.0000.0438.41
4.3.30.0000.0308.41
4.3.20.0030.0338.41
4.3.10.0000.0338.41
4.3.00.0100.0238.41

preferences:
46.59 ms | 401 KiB | 5 Q