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); }, $string);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { [0]=> string(15) "<_link>user://1" [1]=> string(8) "user://1" ["typeUser"]=> string(4) "user" [2]=> string(4) "user" ["userId"]=> string(1) "1" [3]=> string(1) "1" } array(12) { [0]=> string(37) "<_link>tag://FridayBeers|#FridayBeers" [1]=> string(30) "tag://FridayBeers|#FridayBeers" ["typeUser"]=> string(0) "" [2]=> string(0) "" ["userId"]=> string(0) "" [3]=> string(0) "" ["typeTag"]=> string(3) "tag" [4]=> string(3) "tag" ["tagLink"]=> string(11) "FridayBeers" [5]=> string(11) "FridayBeers" ["tagTitle"]=> string(11) "FridayBeers" [6]=> string(11) "FridayBeers" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.6 ms | 402 KiB | 8 Q