3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = "/([a-zA-Z0-9+._-]+)@([a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/"; $template = '<a email-a="%s" email-b="%s">[click to email]</a>'; $str = "bla bla bla firstbit@secondbit.com bla bla bla"; $newStr = preg_replace_callback($pattern, function($matches) use ($template) { [, $local, $host] = $matches; return sprintf($template, $local, $host); }, $str); echo $newStr;
Output for git.master, git.master_jit, rfc.property-hooks
bla bla bla <a email-a="firstbit" email-b="secondbit.com">[click to email]</a> bla bla bla

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