3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { function test() { $this->x(); } static function x() { $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); var_dump($bt[0]['type'] == '->'); var_dump(isset($this)); } }; $x = new c; $x->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NLELu
function name:  (null)
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'c'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class c:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NLELu
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'x'
          1        DO_FCALL                                      0          
    6     2      > RETURN                                                   null

End of function test

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NLELu
function name:  x
number of ops:  15
compiled vars:  !0 = $bt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'debug_backtrace'
          1        SEND_VAL                                                 2
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
    9     4        INIT_FCALL                                               'var_dump'
          5        FETCH_DIM_R                                      ~3      !0, 0
          6        FETCH_DIM_R                                      ~4      ~3, 'type'
          7        IS_EQUAL                                         ~5      ~4, '-%3E'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'var_dump'
         11        ISSET_ISEMPTY_THIS                               ~7      
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                                 
   11    14      > RETURN                                                   null

End of function x

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.88 ms | 1396 KiB | 17 Q