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, strToHex($testPart)); } $packed = pack('nvc*', $testHex[0], $testHex[1], $testHex[2], $testHex[3], $testHex[4], $testHex[5], $testHex[6], $testHex[7]); $unpacked = unpack('nvc*', $packed); $unpackedString = array(); 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.0130.00918.43
8.3.50.0100.00821.99
8.3.40.0070.01018.97
8.3.30.0170.00020.32
8.3.20.0000.00720.31
8.3.10.0050.00322.12
8.3.00.0040.00422.52
8.2.180.0140.00716.63
8.2.170.0070.00722.96
8.2.160.0140.00022.12
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0030.01026.16
8.2.120.0050.00319.38
8.2.110.0090.00022.04
8.2.100.0120.00017.84
8.2.90.0040.00419.21
8.2.80.0040.00419.39
8.2.70.0080.00017.63
8.2.60.0100.00018.04
8.2.50.0000.00918.07
8.2.40.0060.00318.34
8.2.30.0100.00018.15
8.2.20.0030.00617.73
8.2.10.0040.00417.65
8.2.00.0000.00817.67
8.1.280.0110.00725.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00021.84
8.1.230.0110.00019.09
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0100.00017.22
8.1.190.0040.00417.40
8.1.180.0000.00819.01
8.1.170.0040.00418.47
8.1.160.0040.00418.81
8.1.150.0000.00818.70
8.1.140.0050.00217.38
8.1.130.0020.00517.89
8.1.120.0040.00417.51
8.1.110.0030.00517.41
8.1.100.0040.00417.38
8.1.90.0050.00217.43
8.1.80.0000.00817.48
8.1.70.0000.00817.36
8.1.60.0000.00917.50
8.1.50.0080.00017.60
8.1.40.0050.00317.43
8.1.30.0030.00517.64
8.1.20.0000.00817.68
8.1.10.0070.00317.61
8.1.00.0080.00017.56
8.0.300.0050.00218.77
8.0.290.0040.00417.16
8.0.280.0000.00718.47
8.0.270.0040.00417.37
8.0.260.0000.00616.83
8.0.250.0000.00616.87
8.0.240.0040.00417.04
8.0.230.0030.00316.95
8.0.220.0070.00016.90
8.0.210.0000.00716.99
8.0.200.0000.00716.96
8.0.190.0000.00716.96
8.0.180.0040.00416.95
8.0.170.0040.00416.97
8.0.160.0000.00716.89
8.0.150.0070.00016.74
8.0.140.0040.00416.93
8.0.130.0030.00313.38
8.0.120.0030.00516.96
8.0.110.0040.00416.93
8.0.100.0070.00017.02
8.0.90.0000.00816.96
8.0.80.0120.00916.95
8.0.70.0070.00016.96
8.0.60.0000.00816.81
8.0.50.0000.00817.04
8.0.30.0100.01117.17
8.0.20.0140.00417.40
8.0.10.0040.00417.07
8.0.00.0120.00616.83
7.4.330.0000.00715.00
7.4.320.0000.00616.62
7.4.300.0040.00416.63
7.4.290.0040.00416.63
7.4.280.0000.00716.61
7.4.270.0040.00416.52
7.4.260.0060.00316.65
7.4.250.0000.00716.52
7.4.240.0040.00416.50
7.4.230.0000.00716.69
7.4.220.0100.01316.61
7.4.210.0060.01116.58
7.4.200.0070.00016.44
7.4.190.0040.00416.78
7.4.160.0140.00616.48
7.4.150.0070.01117.40
7.4.140.0070.01117.86
7.4.130.0070.00916.43
7.4.120.0100.00816.55
7.4.110.0060.01816.64
7.4.100.0120.00916.56
7.4.90.0070.01016.52
7.4.80.0030.01619.39
7.4.70.0120.00316.60
7.4.60.0100.00616.38
7.4.50.0000.00816.35
7.4.40.0130.00622.77
7.4.30.0030.02116.59
7.4.00.0050.01214.96
7.3.330.0030.00213.25
7.3.320.0050.00013.25
7.3.310.0090.00016.20
7.3.300.0000.00716.34
7.3.290.0150.00316.35
7.3.280.0100.00716.38
7.3.270.0110.00817.40
7.3.260.0000.01816.46
7.3.250.0080.01016.41
7.3.240.0060.01016.33
7.3.230.0130.00316.62
7.3.210.0060.01216.40
7.3.200.0100.00719.39
7.3.190.0080.01516.67
7.3.180.0120.01016.50
7.3.170.0090.01316.66
7.3.160.0100.01116.42
7.3.120.0100.00714.85
7.3.110.0050.01314.87
7.3.100.0100.00614.72
7.3.90.0080.00414.88
7.3.80.0030.01214.94
7.3.70.0060.00714.78
7.3.60.0050.01014.95
7.3.50.0080.00714.78
7.3.40.0030.00714.50
7.3.30.0050.00814.60
7.3.20.0110.00516.52
7.3.10.0080.00716.72
7.3.00.0080.00716.63
7.2.330.0110.00716.73
7.2.320.0140.00516.57
7.2.310.0170.00016.52
7.2.300.0110.00616.74
7.2.290.0100.00916.65
7.2.250.0060.01115.03
7.2.240.0090.01014.98
7.2.230.0070.00914.76
7.2.220.0070.00715.04
7.2.210.0070.01015.09
7.2.200.0070.00714.87
7.2.190.0050.01015.01
7.2.180.0070.00715.17
7.2.170.0080.00415.09
7.2.160.0030.01314.98
7.2.150.0120.00317.05
7.2.140.0030.00617.11
7.2.130.0060.00616.83
7.2.120.0090.00716.99
7.2.110.0050.01216.96
7.2.100.0100.00717.02
7.2.90.0050.01116.95
7.2.80.0050.00717.00
7.2.70.0030.01116.88
7.2.60.0070.00916.73
7.2.50.0060.01016.97
7.2.40.0050.00916.90
7.2.30.0040.01317.03
7.2.20.0020.01316.90
7.2.10.0070.01116.95
7.2.00.0040.01016.90
7.1.330.0040.01115.81
7.1.320.0060.00415.84
7.1.310.0100.00615.57
7.1.300.0060.01015.67
7.1.290.0020.01115.59
7.1.280.0070.00715.47
7.1.270.0070.00715.75
7.1.260.0070.00415.74
7.1.250.0080.00815.74
7.1.240.0100.00815.95
7.1.230.0070.00815.89
7.1.220.0050.00915.81
7.1.210.0050.00615.57
7.1.200.0030.00915.77
7.1.190.0080.00215.53
7.1.180.0080.00915.63
7.1.170.0030.01115.91
7.1.160.0040.00815.64
7.1.150.0060.00815.78
7.1.140.0040.01115.60
7.1.130.0090.00415.79
7.1.120.0090.00715.73
7.1.110.0070.00515.69
7.1.100.0040.01015.72
7.1.90.0070.01015.85
7.1.80.0060.00615.85
7.1.70.0020.01116.14
7.1.60.0060.01217.03
7.1.50.0070.01016.28
7.1.40.0060.00615.73
7.1.30.0030.01015.72
7.1.20.0100.00615.60
7.1.10.0030.01015.56
7.1.00.0060.01617.98
7.0.330.0070.00515.31
7.0.320.0080.00515.35
7.0.310.0050.00715.37
7.0.300.0050.01115.28
7.0.290.0030.01015.33
7.0.280.0060.00815.32
7.0.270.0050.00715.27
7.0.260.0050.00815.31
7.0.250.0030.00915.38
7.0.240.0040.01015.34
7.0.230.0070.00415.35
7.0.220.0070.00815.30
7.0.210.0050.00715.50
7.0.200.0060.00815.27
7.0.190.0030.00815.35
7.0.180.0060.00615.45
7.0.170.0050.00715.49
7.0.160.0080.00515.43
7.0.150.0090.00215.40
7.0.140.0070.02517.70
7.0.130.0040.00715.18
7.0.120.0060.00415.44
7.0.110.0090.00315.32
7.0.100.0070.02916.98
7.0.90.0080.01616.86
7.0.80.0070.02916.91
7.0.70.0030.03216.85
7.0.60.0060.02816.97
7.0.50.0160.03117.17
7.0.40.0070.03215.63
7.0.30.0100.02115.58
7.0.20.0080.03015.66
7.0.10.0080.03315.69
7.0.00.0060.03215.62
5.6.400.0000.01114.58
5.6.390.0040.01114.78
5.6.380.0090.00514.47
5.6.370.0060.00714.63
5.6.360.0050.00714.43
5.6.350.0050.01114.13
5.6.340.0060.00814.34
5.6.330.0060.00914.38
5.6.320.0090.00914.31
5.6.310.0090.00514.46
5.6.300.0040.00913.96
5.6.290.0040.01014.45
5.6.280.0060.02916.56
5.6.270.0030.01014.29
5.6.260.0030.00914.57
5.6.250.0060.02016.48
5.6.240.0110.02816.54
5.6.230.0090.02116.40
5.6.220.0100.03316.42
5.6.210.0050.03216.50
5.6.200.0040.03416.58
5.6.190.0060.03116.53
5.6.180.0090.02516.54
5.6.170.0090.03016.46
5.6.160.0130.02416.48
5.6.150.0110.02216.58
5.6.140.0080.02916.42
5.6.130.0080.01916.43
5.6.120.0060.02016.47
5.6.110.0010.03416.42
5.6.100.0090.02616.45
5.6.90.0080.03216.40
5.6.80.0110.02316.33
5.6.70.0080.01916.44
5.6.60.0040.02116.33
5.6.50.0030.02216.30
5.6.40.0080.03016.20
5.6.30.0080.01516.24
5.6.20.0080.02716.41
5.6.10.0070.02416.28
5.6.00.0070.01716.14
5.5.380.0070.03015.22
5.5.370.0130.02115.27
5.5.360.0070.03215.38
5.5.350.0100.02715.40
5.5.340.0050.02815.36
5.5.330.0030.02415.59
5.5.320.0050.02715.37
5.5.310.0070.03315.37
5.5.300.0060.03315.23
5.5.290.0070.03215.30
5.5.280.0080.02315.33
5.5.270.0030.02215.25
5.5.260.0070.03015.53
5.5.250.0060.02915.41
5.5.240.0020.02715.11
5.5.230.0040.02315.27
5.5.220.0080.02115.28
5.5.210.0080.01815.13
5.5.200.0040.02615.20
5.5.190.0070.01715.22
5.5.180.0050.03115.16
5.5.170.0040.00912.70
5.5.160.0030.03015.19
5.5.150.0030.02415.26
5.5.140.0020.02315.27
5.5.130.0080.01315.07
5.5.120.0050.03015.09
5.5.110.0070.01915.11
5.5.100.0040.02615.19
5.5.90.0020.02915.02
5.5.80.0040.02915.18
5.5.70.0100.01915.08
5.5.60.0050.01815.16
5.5.50.0020.01815.24
5.5.40.0030.01715.02
5.5.30.0050.01615.04
5.5.20.0080.02415.26
5.5.10.0060.03115.21
5.5.00.0060.03115.03
5.4.450.0120.01814.16
5.4.440.0070.02814.06
5.4.430.0080.01614.07
5.4.420.0050.03114.04
5.4.410.0050.03014.13
5.4.400.0060.02714.00
5.4.390.0050.02113.92
5.4.380.0020.03213.97
5.4.370.0040.01813.97
5.4.360.0050.02514.02
5.4.350.0030.03013.95
5.4.340.0030.01714.01
5.4.330.0040.00911.53
5.4.320.0070.02613.97
5.4.310.0020.03213.97
5.4.300.0040.01914.07
5.4.290.0050.01814.03
5.4.280.0060.01913.87
5.4.270.0070.02713.95
5.4.260.0040.02614.07
5.4.250.0040.02814.09
5.4.240.0070.02514.02
5.4.230.0100.02313.96
5.4.220.0060.03113.96
5.4.210.0030.01814.08
5.4.200.0040.02414.11
5.4.190.0030.02414.00
5.4.180.0070.01514.04
5.4.170.0060.02813.93
5.4.160.0060.02214.03
5.4.150.0020.03113.95
5.4.140.0040.02513.03
5.4.130.0050.02813.16
5.4.120.0030.01813.13
5.4.110.0140.02013.20
5.4.100.0040.02513.12
5.4.90.0060.02413.18
5.4.80.0100.02413.03
5.4.70.0030.02613.08
5.4.60.0050.03012.93
5.4.50.0050.01713.14
5.4.40.0080.02413.19
5.4.30.0040.02613.08
5.4.20.0050.02613.07
5.4.10.0050.02913.10
5.4.00.0080.02412.85
5.3.290.0040.01912.43
5.3.280.0020.02012.41
5.3.270.0040.02612.31
5.3.260.0030.03312.38
5.3.250.0030.03012.36
5.3.240.0020.02012.33
5.3.230.0070.03012.41
5.3.220.0040.02712.30
5.3.210.0030.02812.33
5.3.200.0060.02212.32
5.3.190.0020.01912.33
5.3.180.0030.03012.30
5.3.170.0030.03012.34
5.3.160.0050.03112.32
5.3.150.0030.02712.39
5.3.140.0030.01812.33
5.3.130.0050.01912.31
5.3.120.0000.02112.38
5.3.110.0070.03012.30
5.3.100.0050.02012.17
5.3.90.0030.03012.15
5.3.80.0060.02812.14
5.3.70.0000.02712.02
5.3.60.0020.01612.19
5.3.50.0040.02312.05
5.3.40.0070.02412.07
5.3.30.0010.02812.14
5.3.20.0050.01712.11
5.3.10.0040.02011.93
5.3.00.0030.01811.95
5.2.170.0070.03710.90
5.2.160.0030.02510.81
5.2.150.0030.03010.88
5.2.140.0030.01810.83
5.2.130.0100.02210.81
5.2.120.0080.03010.87
5.2.110.0050.03610.70
5.2.100.0030.02010.85
5.2.90.0030.03710.81
5.2.80.0020.01910.74
5.2.70.0040.03110.79
5.2.60.0030.02110.76
5.2.50.0050.01710.64
5.2.40.0020.03510.79
5.2.30.0050.02510.76
5.2.20.0070.02310.71
5.2.10.0020.02910.62
5.2.00.0060.02710.73
5.1.60.0080.01710.32
5.1.50.0040.02710.23
5.1.40.0000.02810.36
5.1.30.0080.02610.39
5.1.20.0030.03110.37
5.1.10.0020.03110.40
5.1.00.0020.01910.29
5.0.50.0090.01810.23
5.0.40.0030.01610.23
5.0.30.0000.03110.23
5.0.20.0020.02510.23
5.0.10.0030.01810.23
5.0.00.0080.02610.23
4.4.90.0050.01910.23
4.4.80.0030.01710.23
4.4.70.0050.01510.23
4.4.60.0000.02110.23
4.4.50.0070.01510.23
4.4.40.0030.02710.23
4.4.30.0020.02210.23
4.4.20.0020.01910.23
4.4.10.0030.02210.23
4.4.00.0030.02310.23
4.3.110.0000.02010.23
4.3.100.0030.01010.23
4.3.90.0050.01710.23
4.3.80.0060.02010.23
4.3.70.0030.01210.23
4.3.60.0020.02010.23
4.3.50.0040.01510.23
4.3.40.0040.02210.23
4.3.30.0030.02010.23
4.3.20.0020.01910.23
4.3.10.0020.01910.23
4.3.00.0030.01010.23

preferences:
47.62 ms | 400 KiB | 5 Q