3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<STR Hello @username you need to check this http://github.com and @username you need to https://stackoverflow.com/questions/ask or https://stackoverflow.com STR; $pattern = "~(?<!\S)(?:(@[^\s@]+)(?!\S)[^h]*(?:h(?!ttp)[^h]*)*+)?\K((?:https?|ftp|file)://\S+)~"; $result = preg_replace_callback($pattern, function($m){ return sprintf('<a href="%s">%s</a>', $m[2],$m[1] ?? $m[2]); }, $string); echo $result;
Output for git.master, git.master_jit, rfc.property-hooks
Hello @username you need to check this <a href="http://github.com">@username</a> and @username you need to <a href="https://stackoverflow.com/questions/ask">@username</a> or <a href="https://stackoverflow.com"></a>

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:
55.31 ms | 1524 KiB | 4 Q