3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "This is <a href="http://foo.com">This is #foo</a>.\nSimple #html-stuff text <a href="http://foobar.com#baz">#simple</a>. \n<span class="simple">simple #simple text text</span>'; $str = preg_replace('/(?!<a[^<>]*>[^#]+)#(\b[-_\w]+\b)(?![^<]*<\/a>)/', '<a href="/tags/$1">#$1</a>', $str); echo $str;
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected 'http' (T_STRING) in /in/GkBfG on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/GkBfG on line 3
Process exited with code 255.