3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = " apply here https://ph.dbsd.com/job/dfvdfg/5444 and www.google.com also http://somesite.net "; $url_regex = "/\b((https?:\/\/?|www\.)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/)))/"; preg_match_all($url_regex, $str, $matches); foreach($matches[0] as $match){ $anchor = "<a href='$match'>$match</a>"; $str = str_replace($match, $anchor, $str); } echo $str; var_dump($matches);
Output for git.master, git.master_jit, rfc.property-hooks
apply here <a href='https://ph.dbsd.com/job/dfvdfg/5444'>https://ph.dbsd.com/job/dfvdfg/5444</a> and <a href='www.google.com'>www.google.com</a> also <a href='http://somesite.net'>http://somesite.net</a> array(4) { [0]=> array(3) { [0]=> string(35) "https://ph.dbsd.com/job/dfvdfg/5444" [1]=> string(14) "www.google.com" [2]=> string(19) "http://somesite.net" } [1]=> array(3) { [0]=> string(35) "https://ph.dbsd.com/job/dfvdfg/5444" [1]=> string(14) "www.google.com" [2]=> string(19) "http://somesite.net" } [2]=> array(3) { [0]=> string(8) "https://" [1]=> string(4) "www." [2]=> string(7) "http://" } [3]=> array(3) { [0]=> string(1) "4" [1]=> string(1) "m" [2]=> string(1) "t" } }

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:
42.51 ms | 1402 KiB | 4 Q