3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "this is the link: https://stackoverflow.com/questions/ask"; $linktext = preg_replace_callback("/([\w]+\:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/", function ($m) { $url = $m[0]; $parts = parse_url($url); $parts["host"] = str_replace("www.", "", $parts["host"]); array_shift($parts); $shortURL = implode("", $parts); $shortenedURL = substr($shortURL, 0, 20); if (strlen($shortURL) > 20) $shortenedURL .= "..."; return "<a href=\"".$url."\">".$shortenedURL."</a>"; var_dump($parts); }, $url); echo $linktext;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: preg_replace_callback(): Compilation failed: invalid range in character class at offset 15 in /in/mFdPG on line 5

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