3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /* <_link>user://1|Team GB <a href="user/1">Team GB</a> <_link>tag://FridayBeers|#FridayBeers <a href="tags/FridayBeers">#FridayBeers</a> */ $pattern = "~\<_link\>((?<typeUser>user)\://(?<userId>\d+)|(?<typeTag>tag)\://(?<tagLink>[a-zA-Z]+)\|#(?<tagTitle>[a-zA-Z]+))~"; $string = "<_link>user://1|Team GB and <_link>tag://FridayBeers|#FridayBeers"; preg_replace_callback($pattern, function($match) { var_dump($match); if( }, $string);
Output for 5.3.0 - 5.4.25
Parse error: syntax error, unexpected '}' in /in/bqsQq on line 18
Process exited with code 255.