3v4l.org

run code in 500+ PHP versions simultaneously
<?php function argByRef(&$arg) { debugLogger(); print_r($arg); } function debugLogger() { $bt = debug_backtrace(); $bt[1]['args'][0] = 'bar'; } $arg = 'foo'; argByRef($arg);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mf41V
function name:  (null)
number of ops:  5
compiled vars:  !0 = $arg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                       !0, 'foo'
   14     1        INIT_FCALL                                                   'argbyref'
          2        SEND_REF                                                     !0
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

Function argbyref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mf41V
function name:  argByRef
number of ops:  7
compiled vars:  !0 = $arg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        INIT_FCALL_BY_NAME                                           'debugLogger'
          2        DO_FCALL                                          0          
    5     3        INIT_FCALL                                                   'print_r'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                                     
    6     6      > RETURN                                                       null

End of function argbyref

Function debuglogger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mf41V
function name:  debugLogger
number of ops:  8
compiled vars:  !0 = $bt
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'debug_backtrace'
          1        DO_ICALL                                             $1      
          2        ASSIGN                                                       !0, $1
   10     3        FETCH_DIM_W                                          $3      !0, 1
          4        FETCH_DIM_W                                          $4      $3, 'args'
          5        ASSIGN_DIM                                                   $4, 0
          6        OP_DATA                                                      'bar'
   11     7      > RETURN                                                       null

End of function debuglogger

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
123.48 ms | 481 KiB | 10 Q