3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clean_link($a) { return "change"; } function run($str) { $eval_links = '$link = clean_link("$0")'; return preg_replace_callback('{tst}i',function ($matches) use ($eval_links) { return $link = clean_link($matches[0]); },$str); } echo run('test');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zm16C
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'run'
          1        SEND_VAL                                                 'test'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

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

End of function clean_link

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zm16C
function name:  run
number of ops:  11
compiled vars:  !0 = $str, !1 = $eval_links
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        ASSIGN                                                   !1, '%24link+%3D+clean_link%28%22%240%22%29'
   12     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAL                                                 '%7Btst%7Di'
          4        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          5        BIND_LEXICAL                                             ~3, !1
   14     6        SEND_VAL                                                 ~3
          7        SEND_VAR                                                 !0
   12     8        DO_ICALL                                         $4      
   14     9      > RETURN                                                   $4
   15    10*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zm16C
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $matches, !1 = $eval_links, !2 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   13     2        INIT_FCALL                                               'clean_link'
          3        FETCH_DIM_R                                      ~3      !0, 0
          4        SEND_VAL                                                 ~3
          5        DO_FCALL                                      0  $4      
          6        ASSIGN                                           ~5      !2, $4
          7      > RETURN                                                   ~5
   14     8*     > RETURN                                                   null

End of Dynamic Function 0

End of function run

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.71 ms | 1091 KiB | 16 Q