3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // The Regular Expression filter $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; // The Text you want to filter for urls $text = "The text you want to filter goes here. http://www.snoodo.com"; // Check if there is a url in the text if(preg_match($reg_exUrl, $text, $url)) { // make the urls hyper links echo preg_replace($reg_exUrl, "<a href="{$url[0]}">{$url[0]}</a> ", $text); } else { // if no urls in the text just return the text echo $text; }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.26
Parse error: syntax error, unexpected '{' in /in/kSdrX on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '{' in /in/kSdrX on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/kSdrX on line 12
Process exited with code 255.