3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[img]http://www.test.com/abc.jpg[/img]"; $uid = 123; $text = preg_replace_callback( "#\[img]((?:https?|ftps?)://[^\s?&=\#\"<]*?\.(?:jpe?g|gif|png))\[/img]#i", function ($m) use ($uid) { return "[img:$uid]" . $m[1] . "[/img:$uid]"; }, $text ); echo $text;
Output for git.master_jit, git.master, rfc.property-hooks
[img:123]http://www.test.com/abc.jpg[/img:123]

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