3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function foo() { if (isset($this)) { echo '$this is defined ('; echo get_class($this); echo ") "; } else { echo "$this is not defined. "; } } } class B { function bar() { A::foo(); } } $a = new A(); $a->foo(); A::foo(); $b = new B(); $b->bar(); B::bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ROkm
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
   26     5        INIT_STATIC_METHOD_CALL                                  'A', 'foo'
          6        DO_FCALL                                      0          
   27     7        NEW                                              $7      'B'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   28    10        INIT_METHOD_CALL                                         !1, 'bar'
         11        DO_FCALL                                      0          
   29    12        INIT_STATIC_METHOD_CALL                                  'B', 'bar'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 8
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ROkm
function name:  foo
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ISSET_ISEMPTY_THIS                               ~0      
          1      > JMPZ                                                     ~0, ->8
    7     2    >   ECHO                                                     '%24this+is+defined+%28'
    8     3        FETCH_THIS                                       ~1      
          4        GET_CLASS                                        ~2      ~1
          5        ECHO                                                     ~2
    9     6        ECHO                                                     '%29+'
          7      > JMP                                                      ->12
   11     8    >   FETCH_THIS                                       ~3      
          9        NOP                                                      
         10        FAST_CONCAT                                      ~4      ~3, '+is+not+defined.+'
         11        ECHO                                                     ~4
   13    12    > > RETURN                                                   null

End of function foo

End of class A.

Class B:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ROkm
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'foo'
          1        DO_FCALL                                      0          
   21     2      > RETURN                                                   null

End of function bar

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.12 ms | 1395 KiB | 13 Q