3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function autoLink($str) { return preg_replace('/((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/iu', '<a href="$1" target="_blank">$1</a>', $str); } var_dump(autoLink('to jst link http://www.google.pl do gogle'));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(92) "to jst link <a href="http://www.google.pl" target="_blank">http://www.google.pl</a> do gogle"