3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hex_dump($data, $newline = "\n") { static $from = ''; static $to = ''; static $idxOffset = 8; static $width = 16; # number of bytes per line static $pad = '.'; # padding for non-visible characters static $hexPad = '00'; static $repeatHeadline = 5; if ($from === '') { for ($i = 0; $i <= 0xFF; ++$i) { $from .= chr($i); $to .= ($i >= 0x20 && $i <= 0x7E) ? chr($i) : $pad; } } $text = true; echo ($text) ? '' : '<pre>'; $head = str_repeat(' ', $idxOffset).' | '. implode(' ', array_map( create_function( '$str', 'return sprintf("%2X", $str);' ), range(0, $width - 1) )).' | '.(str_pad('', $width, '0123456789abcdef')).$newline; $separator = str_repeat('-', $idxOffset + 1).'+'.str_repeat('-', 3 * $width + 1).'+'. str_repeat('-', $width + 1).$newline; echo $head.$separator; $hex = str_split(bin2hex($data), $width * 2); $chars = str_split(strtr($data, $from, $to), $width); $hexLineBase = array_fill(0, $width, $hexPad); $offset = $c = 0; foreach ($hex as $i => $line) { $hexLine = str_split($line, 2) + $hexLineBase; $strLine = $chars[$i].str_repeat($pad, $width - strlen($chars[$i])); $line = sprintf('%'.$idxOffset.'X', $offset) . ' | ' . implode(' ', $hexLine) . ' | ' . $strLine . $newline; echo ($text) ? $line : htmlspecialchars($line); $offset += $width; if (++$c == $repeatHeadline) { echo $separator.$head.$separator; $c = 0; } } echo ($text) ? $newline.$newline : '<pre>'; } hex_dump(' \t\n\r\x0B'); hex_dump(" \t\n\r\x0B");

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.0120.00318.56
8.3.50.0150.00822.02
8.3.40.0110.00718.92
8.3.30.0110.00419.07
8.3.20.0070.00020.34
8.3.10.0080.00023.52
8.3.00.0040.00717.75
8.2.180.0040.01216.63
8.2.170.0110.00422.96
8.2.160.0070.00720.37
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0050.00220.98
8.2.110.0030.00722.27
8.2.100.0040.00817.59
8.2.90.0040.00418.03
8.2.80.0000.00817.97
8.2.70.0060.00317.75
8.2.60.0000.00817.93
8.2.50.0080.00018.07
8.2.40.0030.00618.22
8.2.30.0040.00418.10
8.2.20.0000.00817.96
8.2.10.0040.00418.04
8.2.00.0070.00317.91
8.1.280.0060.00925.92
8.1.270.0080.00023.92
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0030.00622.50
8.1.230.0070.00420.95
8.1.220.0000.00817.74
8.1.210.0050.00318.85
8.1.200.0070.00317.35
8.1.190.0050.00317.38
8.1.180.0050.00318.10
8.1.170.0040.00418.59
8.1.160.0020.00522.05
8.1.150.0040.00418.93
8.1.140.0040.00417.41
8.1.130.0030.00517.77
8.1.120.0000.00817.41
8.1.110.0040.00417.48
8.1.100.0070.00017.49
8.1.90.0000.00717.55
8.1.80.0000.00817.57
8.1.70.0030.00317.49
8.1.60.0060.00317.67
8.1.50.0080.00017.58
8.1.40.0000.00817.46
8.1.30.0040.00417.65
8.1.20.0030.00617.60
8.1.10.0000.00817.55
8.1.00.0000.00817.44
8.0.300.0070.00020.03
8.0.290.0100.00016.75
8.0.280.0050.00318.49
8.0.270.0040.00416.93
8.0.260.0070.00017.18
8.0.250.0000.00717.11
8.0.240.0060.00016.94
8.0.230.0030.00417.04
8.0.220.0070.00017.06
8.0.210.0000.00717.01
8.0.200.0040.00416.90
8.0.190.0000.00817.09
8.0.180.0050.00217.00
8.0.170.0060.00317.03
8.0.160.0000.00717.04
8.0.150.0040.00416.84
8.0.140.0040.00416.78
8.0.130.0030.00313.48
8.0.120.0040.00416.95
8.0.110.0050.00317.02
8.0.100.0040.00417.06
8.0.90.0050.00317.03
8.0.80.0060.00916.95
8.0.70.0040.00416.99
8.0.60.0040.00417.00
8.0.50.0000.00717.04
8.0.30.0120.00717.13
8.0.20.0120.01217.40
8.0.10.0080.00017.03
8.0.00.0100.00817.07
7.4.330.0050.00015.13
7.4.320.0030.00316.72
7.4.300.0040.00416.54
7.4.290.0000.00716.63
7.4.280.0060.00616.55
7.4.270.0030.00316.66
7.4.260.0000.00816.55
7.4.250.0000.01016.63
7.4.240.0020.00516.70
7.4.230.0050.00316.58
7.4.220.0180.00916.65
7.4.210.0100.00316.73
7.4.200.0050.00216.77
7.4.160.0060.01016.48
7.4.150.0090.00917.40
7.4.140.0090.01017.86
7.4.130.0100.01116.60
7.4.120.0080.01316.66
7.4.110.0050.01316.68
7.4.100.0060.01216.59
7.4.90.0030.01516.65
7.4.80.0110.01119.39
7.4.70.0090.00616.78
7.4.60.0090.00616.67
7.4.50.0030.00516.76
7.4.40.0030.01416.54
7.4.30.0080.00816.42
7.4.00.0070.01015.14
7.3.330.0040.00413.26
7.3.320.0030.00313.50
7.3.310.0000.00716.44
7.3.300.0040.00416.49
7.3.290.0050.00816.49
7.3.280.0090.00916.50
7.3.270.0120.00417.40
7.3.260.0130.01316.57
7.3.250.0080.00816.48
7.3.240.0030.01316.66
7.3.230.0160.00016.49
7.3.210.0060.01116.68
7.3.200.0130.00719.39
7.3.190.0200.00316.62
7.3.180.0110.00416.67
7.3.170.0060.00916.66
7.3.160.0140.00916.46
7.3.00.0090.00316.77
7.2.330.0100.01016.70
7.2.320.0070.01116.74
7.2.310.0040.01516.59
7.2.300.0050.01116.79
7.2.290.0180.01816.39
7.2.130.0040.00817.04
7.2.120.0000.01116.88
7.2.110.0050.01016.60
7.2.100.0060.00617.01
7.2.90.0030.01016.89
7.2.80.0100.00316.77
7.2.70.0120.00416.98
7.2.60.0070.00617.05
7.2.50.0060.00617.09
7.2.40.0100.00716.98
7.2.30.0060.00616.94
7.2.20.0070.00717.13
7.2.10.0100.00016.88
7.2.00.0000.01318.28
7.1.250.0080.00315.66
7.1.240.0040.00815.68
7.1.230.0090.00615.75
7.1.220.0030.00815.48
7.1.210.0040.00815.80
7.1.200.0050.00915.88
7.1.190.0040.00715.64
7.1.180.0130.00315.90
7.1.170.0000.01115.87
7.1.160.0000.01315.72
7.1.150.0080.00815.80
7.1.140.0090.00615.87
7.1.130.0070.01115.62
7.1.120.0030.00616.05
7.1.110.0030.01015.84
7.1.100.0470.00516.13
7.1.90.0060.00615.62
7.1.80.0040.00715.72
7.1.70.0050.00616.55
7.1.60.0070.01317.53
7.1.50.0110.00516.46
7.1.40.0070.00715.98
7.1.30.0030.01215.99
7.1.20.0030.00815.95
7.1.10.0090.00615.95
7.1.00.0070.04019.14
7.0.330.0000.01015.41
7.0.320.0070.00715.40
7.0.310.0000.00915.22
7.0.300.0070.00715.26
7.0.290.0070.01015.46
7.0.280.0030.01015.45
7.0.270.0070.00715.50
7.0.260.0080.00015.60
7.0.250.0030.01015.44
7.0.240.0120.00015.56
7.0.230.0060.00715.43
7.0.220.0000.00815.46
7.0.210.0070.01015.23
7.0.200.0030.00515.90
7.0.190.0090.00515.39
7.0.180.0030.00715.43
7.0.170.0110.00515.33
7.0.160.0080.00515.48
7.0.150.0030.00615.41
7.0.140.0060.04118.85
7.0.130.0040.00415.53
7.0.120.0070.00715.45
7.0.110.0120.04017.82
7.0.100.0070.03517.72
7.0.90.0120.03717.78
7.0.80.0020.04717.62
7.0.70.0130.04017.72
7.0.60.0090.02617.75
7.0.50.0080.03317.74
7.0.40.0070.04716.43
7.0.30.0080.04016.60
7.0.20.0100.04016.65
7.0.10.0130.03816.69
7.0.00.0080.03816.52
5.6.380.0040.00414.46
5.6.370.0100.00314.20
5.6.360.0060.00314.63
5.6.350.0060.00914.59
5.6.340.0000.01314.27
5.6.330.0030.01014.43
5.6.320.0040.00714.35
5.6.310.0000.01414.70
5.6.300.0060.00914.47
5.6.290.0030.00614.39
5.6.280.0050.03817.62
5.6.270.0030.00914.46
5.6.260.0050.04217.67
5.6.250.0090.03917.45
5.6.240.0030.03017.64
5.6.230.0070.03917.43
5.6.220.0080.04517.51
5.6.210.0080.04217.60
5.6.200.0030.04617.46
5.6.190.0070.04017.50
5.6.180.0120.04017.62
5.6.170.0040.04317.44
5.6.160.0120.04017.42
5.6.150.0100.03717.41
5.6.140.0070.04117.33
5.6.130.0050.04217.54
5.6.120.0020.04017.52
5.6.110.0090.04317.42
5.6.100.0030.04817.41
5.6.90.0080.04017.27
5.6.80.0080.04317.13
5.6.70.0080.03817.11
5.6.60.0060.02517.23
5.6.50.0030.02317.28
5.6.40.0070.03917.08
5.6.30.0120.03517.07
5.6.20.0070.03017.09
5.6.10.0050.04116.92
5.6.00.0070.04417.02
5.5.380.0030.02314.22
5.5.370.0050.04014.33
5.5.360.0020.04714.49
5.5.350.0030.03114.28
5.5.340.0080.03314.61
5.5.330.0050.04114.66
5.5.320.0060.03614.63
5.5.310.0070.04214.59
5.5.300.0030.04114.59
5.5.290.0110.02414.72
5.5.280.0040.04414.68
5.5.270.0080.03714.67
5.5.260.0080.04114.51
5.5.250.0050.02214.41
5.5.240.0070.04114.17
5.5.230.0050.04014.31
5.5.220.0120.03714.31
5.5.210.0070.03014.24
5.5.200.0020.02214.24
5.5.190.0030.02014.30
5.5.180.0050.04314.29
5.5.170.0040.00411.05
5.5.160.0080.03914.45
5.5.150.0050.04114.14
5.5.140.0030.04114.38
5.5.130.0030.03314.35
5.5.120.0080.03614.39
5.5.110.0100.03314.15
5.5.100.0050.03014.13
5.5.90.0020.04214.08
5.5.80.0020.04514.47
5.5.70.0090.03614.36
5.5.60.0020.02714.29
5.5.50.0060.03914.20
5.5.40.0030.03914.24
5.5.30.0080.02614.25
5.5.20.0100.02314.24
5.5.10.0000.04314.38
5.5.00.0100.03714.27
5.4.450.0030.04415.14
5.4.440.0100.03315.28
5.4.430.0060.04315.32
5.4.420.0120.03215.37
5.4.410.0060.03615.26
5.4.400.0070.04215.19
5.4.390.0040.02515.19
5.4.380.0070.03415.12
5.4.370.0000.04315.22
5.4.360.0050.04215.17
5.4.350.0100.03715.12
5.4.340.0030.04315.21
5.4.330.0000.01011.28
5.4.320.0020.02715.09
5.4.310.0030.03515.03
5.4.300.0060.03715.11
5.4.290.0030.03315.04
5.4.280.0050.04315.28
5.4.270.0050.04215.16
5.4.260.0080.03815.21
5.4.250.0090.04015.10
5.4.240.0000.04615.12
5.4.230.0100.03815.00
5.4.220.0060.03815.18
5.4.210.0050.04015.07
5.4.200.0100.03815.24
5.4.190.0080.03215.01
5.4.180.0100.02515.00
5.4.170.0070.04215.00
5.4.160.0020.04615.06
5.4.150.0070.03915.04
5.4.140.0070.03913.84
5.4.130.0080.02513.85
5.4.120.0030.04013.83
5.4.110.0070.03413.78
5.4.100.0030.03513.80
5.4.90.0060.04013.95
5.4.80.0030.03613.78
5.4.70.0070.02013.83
5.4.60.0060.03513.76
5.4.50.0050.02113.86
5.4.40.0020.02113.72
5.4.30.0070.02313.91
5.4.20.0090.02913.80
5.4.10.0070.03813.93
5.4.00.0050.03313.62
5.3.290.0070.04212.87
5.3.280.0050.03612.89
5.3.270.0070.03812.76
5.3.260.0020.04612.80
5.3.250.0070.03912.83
5.3.240.0100.03212.82
5.3.230.0080.03612.83
5.3.220.0150.03812.82
5.3.210.0060.03612.81
5.3.200.0070.04112.87
5.3.190.0020.04212.92
5.3.180.0030.02812.81
5.3.170.0050.03812.92
5.3.160.0120.03212.80
5.3.150.0070.03812.81
5.3.140.0010.02112.81
5.3.130.0030.03812.78
5.3.120.0070.02512.79
5.3.110.0090.03812.79
5.3.100.0020.02112.62
5.3.90.0050.03712.53
5.3.80.0070.03712.55
5.3.70.0050.02612.56
5.3.60.0050.03812.52
5.3.50.0070.04212.56
5.3.40.0060.03812.54
5.3.30.0120.03312.53
5.3.20.0030.04312.38
5.3.10.0050.02512.35
5.3.00.0030.03512.34
5.2.170.0030.03311.09
5.2.160.0030.03511.13
5.2.150.0020.03911.02
5.2.140.0030.02111.21
5.2.130.0020.03711.11
5.2.120.0020.02211.06
5.2.110.0050.03211.00
5.2.100.0050.03011.19
5.2.90.0030.02211.09
5.2.80.0070.02211.05
5.2.70.0000.02311.19
5.2.60.0030.02011.05
5.2.50.0020.03711.03
5.2.40.0030.01811.01
5.2.30.0030.01611.02
5.2.20.0060.01711.04
5.2.10.0020.03210.96
5.2.00.0050.02510.89
5.1.60.0080.02510.60
5.1.50.0050.03010.54
5.1.40.0030.03010.54
5.1.30.0030.02810.68
5.1.20.0030.02610.73
5.1.10.0020.03210.55
5.1.00.0050.03010.64
5.0.50.0020.02210.54
5.0.40.0050.02310.54
5.0.30.0020.03510.54
5.0.20.0020.02510.54
5.0.10.0040.01410.54
5.0.00.0040.02910.54
4.4.90.0020.00810.54
4.4.80.0000.01910.54
4.4.70.0040.01010.54
4.4.60.0000.02010.54
4.4.50.0020.01310.54
4.4.40.0040.02510.54
4.4.30.0030.01610.54
4.4.20.0000.01810.54
4.4.10.0050.01510.54
4.4.00.0040.02510.54
4.3.110.0000.02210.54
4.3.100.0030.01810.54
4.3.90.0020.01910.54
4.3.80.0020.02910.54
4.3.70.0060.01110.54
4.3.60.0000.02110.54
4.3.50.0030.02010.54
4.3.40.0040.02210.54
4.3.30.0010.01610.54
4.3.20.0000.02110.54
4.3.10.0020.01810.54
4.3.00.0020.01910.54

preferences:
41.05 ms | 401 KiB | 5 Q