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\>((user)\://(?<userId>\d+)|(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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kY7mq
function name:  (null)
number of ops:  9
compiled vars:  !0 = $pattern, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, '%7E%5C%3C_link%5C%3E%28%28user%29%5C%3A%2F%2F%28%3F%3CuserId%3E%5Cd%2B%29%7C%28tag%29%5C%3A%2F%2F%28%3F%3CtagLink%3E%5Ba-zA-Z%5D%2B%5C%7C%23%28%3F%3CtagTitle%3E%5Ba-zA-Z%5D%2B%29%7E'
   12     1        ASSIGN                                                   !1, '%3C_link%3Euser%3A%2F%2F1%7CTeam+GB+and+%3C_link%3Etag%3A%2F%2FFridayBeers%7C%23FridayBeers'
   14     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkY7mq%3A14%240'
   16     5        SEND_VAL                                                 ~4
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FkY7mq%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kY7mq
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   16     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FkY7mq%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.1 ms | 1395 KiB | 17 Q