3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '/\{link ([0-9]+)/'; $subject = 'Hello World! {link 123456#abc}TEST{/link} Bla!'; echo preg_replace_callback($regex, function (array $matches) { var_export($matches); return $matches[1] . 'ABC'; }, $subject);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0GMsm
function name:  (null)
number of ops:  10
compiled vars:  !0 = $regex, !1 = $subject
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5C%7Blink+%28%5B0-9%5D%2B%29%2F'
    4     1        ASSIGN                                                   !1, 'Hello+World%21+%7Blink+123456%23abc%7DTEST%7B%2Flink%7D+Bla%21'
    6     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0GMsm%3A6%240'
    9     5        SEND_VAL                                                 ~4
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F0GMsm%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0GMsm
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'var_export'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    8     4        FETCH_DIM_R                                      ~2      !0, 1
          5        CONCAT                                           ~3      ~2, 'ABC'
          6      > RETURN                                                   ~3
    9     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F0GMsm%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.17 ms | 1395 KiB | 17 Q