3v4l.org

run code in 300+ PHP versions simultaneously
<?php function prepareForOutput($content, $exclude=[]) { $replacements = [ "\r" => '\r', "\n" => '\n', "\t" => '\t', " " => '·', ]; if (stripos(PHP_OS, 'WIN') === 0 && PHP_VERSION_ID < 70100) { // Do not replace spaces on old PHP on Windows. // Printing Unicode characters like '·' to Windows console only works since PHP 7.1. unset($replacements[" "]); } $replacements = array_diff_key($replacements, array_fill_keys($exclude, true)); // Colour runs of invisible characters. $match = implode('', array_keys($replacements)); $content = preg_replace("/([$match]+)/", "\033[30;1m$1\033[0m", $content); $content = strtr($content, $replacements); return $content; } for ($i = 0; $i < 10000; $i++) { prepareForOutput('{echo 1;}', ["\r"]); }
Output for git.master_jit, git.master, rfc.property-hooks

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:
94.4 ms | 405 KiB | 5 Q