3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace_callback($matches){ return $matches[0]; } $str = "abc{123}def{456}ghi{789}jkl"; $result = preg_replace_callback('/\{.*?\}/', 'replace_callback', $str); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r8iIh
function name:  (null)
number of ops:  11
compiled vars:  !0 = $str, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'abc%7B123%7Ddef%7B456%7Dghi%7B789%7Djkl'
    8     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%5C%7B.%2A%3F%5C%7D%2F'
          3        SEND_VAL                                                 'replace_callback'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    9     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function replace_callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r8iIh
function name:  replace_callback
number of ops:  4
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        FETCH_DIM_R                                      ~1      !0, 0
          2      > RETURN                                                   ~1
    6     3*     > RETURN                                                   null

End of function replace_callback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.98 ms | 1395 KiB | 17 Q