3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace_callback($matches){ return $matches; } $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/91TDX
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%5B%28.%2A%29%7B.%2A%7D%5D%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/91TDX
function name:  replace_callback
number of ops:  3
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1      > RETURN                                                   !0
    6     2*     > RETURN                                                   null

End of function replace_callback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.19 ms | 1399 KiB | 17 Q