3v4l.org

run code in 300+ PHP versions simultaneously
<?php function txt2link($text){ // force http: on www. $text = ereg_replace( "www\.", "http://www.", $text ); // eliminate duplicates after force $text = ereg_replace( "http://http://www\.", "http://www.", $text ); $text = ereg_replace( "https://http://www\.", "https://www.", $text ); // The Regular Expression filter $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; // Check if there is a url in the text if(preg_match($reg_exUrl, $text, $url)) { // make the urls hyper links $text = preg_replace($reg_exUrl, '<a href="'.$url[0].'" rel="nofollow">'.$url[0].'</a>', $text); } // if no urls in the text just return the text return ($text); } echo txt2link('http://www.snoodo.com');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /in/lt9Ym:4 Stack trace: #0 /in/lt9Ym(19): txt2link('http://www.snoo...') #1 {main} thrown in /in/lt9Ym on line 4
Process exited with code 255.

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