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");
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function create_function() in /in/AlFrp:45 Stack trace: #0 /in/AlFrp(78): hex_dump(' \\t\\n\\r\\x0B') #1 {main} thrown in /in/AlFrp on line 45
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.87 ms | 401 KiB | 8 Q