3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\[@url\|([^|]+)\|(\d+)\](?=(?>.*\R+)+^\[\2]:\s+(\S+))|^\[\d+]:\h+\S+/m'; $str = 'We have [@url|first url|1] and the [@url|the second url|2] and then [@url|the third url|3] [1]: https://www.google.com [2]: www.facebook.com [3]: http://www.amazon.com'; echo preg_replace_callback($re, function($match) { if (isset($match[1])) { return "<a href=\"{$match[3]}\">{$match[1]}</a>"; } }, $str);
Output for git.master, git.master_jit, rfc.property-hooks
We have <a href="https://www.google.com">first url</a> and the <a href="www.facebook.com">the second url</a> and then <a href="http://www.amazon.com">the third url</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:
165.55 ms | 405 KiB | 5 Q