3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "<p>Some string www.test.com with urls http://test.com in it http://www.test.com.</p>"; if(preg_match_all("/((http|https)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z0-9\&\.\/\?\:@\-_=#])*/",$text,$urls)){ foreach($urls[0]as $url ){ $text = str_replace($url,'<a href="'.$url.'">'.$url.'</a>',$text); } } echo $text;
Output for git.master, git.master_jit, rfc.property-hooks
<p>Some string <a href="www.test.com">www.test.com</a> with urls <a href="http://test.com">http://test.com</a> in it http://<a href="www.test.com">www.test.com</a>.</p>

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:
52.24 ms | 401 KiB | 8 Q