3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('str_split')) {         function str_split($text, $split = 1)        {            $array = array();                        for ($i = 0; $i < strlen($text);)            {                $array[] = substr($text, $i, $split);                $i += $split;            }                        return $array;        } } 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)
5.4.340.0060.03512.01
5.4.320.0040.04412.50
5.4.310.0060.04212.49
5.4.300.0080.03712.49
5.4.290.0060.04012.49
5.4.280.0090.03412.39
5.4.270.0050.03612.39
5.4.260.0080.04112.39
5.4.250.0020.04012.39
5.4.240.0060.03512.39
5.4.230.0060.04012.38
5.4.220.0070.03912.38
5.4.210.0030.04012.38
5.4.200.0070.03812.38
5.4.190.0050.03612.38
5.4.180.0070.03612.38
5.4.170.0040.04012.39
5.4.160.0060.03912.38
5.4.150.0030.03912.38
5.4.140.0050.03712.07
5.4.130.0040.03912.05
5.4.120.0080.03712.01
5.4.110.0030.03712.01
5.4.100.0080.03212.02
5.4.90.0060.03512.01
5.4.80.0080.03312.01
5.4.70.0060.03312.00
5.4.60.0050.03412.00
5.4.50.0060.03412.00
5.4.40.0040.04112.00
5.4.30.0090.03611.99
5.4.20.0040.04211.99
5.4.10.0070.03712.00
5.4.00.0060.03411.49
5.3.290.0090.04412.80
5.3.280.0030.04012.71
5.3.270.0040.04112.73
5.3.260.0040.03912.72
5.3.250.0050.03712.72
5.3.240.0070.03612.71
5.3.230.0060.03712.71
5.3.220.0070.04012.68
5.3.210.0020.04812.68
5.3.200.0060.03512.68
5.3.190.0040.03812.68
5.3.180.0060.03612.67
5.3.170.0050.03712.66
5.3.160.0100.03812.67
5.3.150.0040.03812.68
5.3.140.0020.04012.66
5.3.130.0070.03712.66
5.3.120.0080.03612.65
5.3.110.0040.04112.66
5.3.100.0090.03912.12
5.3.90.0050.03512.09
5.3.80.0080.03312.08
5.3.70.0050.03612.08
5.3.60.0070.03812.06
5.3.50.0060.03612.00
5.3.40.0030.03812.00
5.3.30.0070.03311.95
5.3.20.0040.03711.73
5.3.10.0040.03611.70
5.3.00.0080.03411.68
5.2.170.0030.0329.19
5.2.160.0060.0389.18
5.2.150.0090.0389.18
5.2.140.0090.0409.18
5.2.130.0040.0309.14
5.2.120.0020.0319.14
5.2.110.0070.0269.15
5.2.100.0060.0299.14
5.2.90.0060.0309.14
5.2.80.0020.0339.14
5.2.70.0050.0299.14
5.2.60.0040.0299.09
5.2.50.0050.0359.07
5.2.40.0030.0309.04
5.2.30.0030.0319.01
5.2.20.0020.0319.01
5.2.10.0040.0288.92
5.2.00.0040.0288.79
5.1.60.0020.0268.07
5.1.50.0030.0258.07
5.1.40.0010.0318.04
5.1.30.0050.0248.40
5.1.20.0070.0258.41
5.1.10.0040.0258.15
5.1.00.0060.0238.14
5.0.50.0020.0216.62
5.0.40.0030.0206.48
5.0.30.0030.0316.29
5.0.20.0040.0186.26
5.0.10.0060.0176.24
5.0.00.0040.0346.24
4.4.90.0020.0154.78
4.4.80.0030.0144.76
4.4.70.0040.0204.75
4.4.60.0040.0134.76
4.4.50.0030.0224.77
4.4.40.0040.0254.70
4.4.30.0010.0164.76
4.4.20.0010.0174.85
4.4.10.0030.0154.85
4.4.00.0030.0244.76
4.3.110.0030.0164.67
4.3.100.0020.0154.66
4.3.90.0010.0204.63
4.3.80.0020.0244.59
4.3.70.0030.0144.63
4.3.60.0020.0154.63
4.3.50.0000.0184.63
4.3.40.0040.0224.54
4.3.30.0030.0143.28
4.3.20.0030.0153.26
4.3.10.0030.0143.22
4.3.00.0000.0237.14

preferences:
143.19 ms | 1394 KiB | 7 Q