3v4l.org

run code in 300+ PHP versions simultaneously
<?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.4.25
Parse error: syntax error, unexpected '}' in /in/bqsQq on line 18
Process exited with code 255.

preferences:
164.21 ms | 1394 KiB | 8 Q