3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $prop = 0; public function callBar() { $this->prop = 100; var_dump($this); $b = new Bar(); $b->trace(); } } class Bar { public function trace() { $bt = debug_backtrace(); var_dump($bt[1]["object"]); } } $f = new Foo(); $f->callBar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dS2jQ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'callBar'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Foo:
Function callbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dS2jQ
function name:  callBar
number of ops:  12
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OBJ                                               'prop'
          1        OP_DATA                                                  100
    8     2        INIT_FCALL                                               'var_dump'
          3        FETCH_THIS                                       ~2      
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   10     6        NEW                                              $4      'Bar'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $4
   11     9        INIT_METHOD_CALL                                         !0, 'trace'
         10        DO_FCALL                                      0          
   12    11      > RETURN                                                   null

End of function callbar

End of class Foo.

Class Bar:
Function trace:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dS2jQ
function name:  trace
number of ops:  9
compiled vars:  !0 = $bt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'debug_backtrace'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'var_dump'
          4        FETCH_DIM_R                                      ~3      !0, 1
          5        FETCH_DIM_R                                      ~4      ~3, 'object'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   19     8      > RETURN                                                   null

End of function trace

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.81 ms | 944 KiB | 18 Q