3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function a1() { static::foo(); } static public function a2() { static::foo(); } static public function foo() { echo 'A'; } } class B { public function b1() { $this->a1(); A::a2(); } static public function b2() { $this->a1(); A::a2(); } static public function foo() { echo 'B'; } } B::b1();//A B::b2();//A $b = new B; $b->b1();//B $b->b2();//A
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A9m0F
function name:  (null)
number of ops:  12
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'b1'
          1        DO_FCALL                                      0          
   42     2        INIT_STATIC_METHOD_CALL                                  'B', 'b2'
          3        DO_FCALL                                      0          
   44     4        NEW                                              $3      'B'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   45     7        INIT_METHOD_CALL                                         !0, 'b1'
          8        DO_FCALL                                      0          
   46     9        INIT_METHOD_CALL                                         !0, 'b2'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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

End of function a1

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

End of function a2

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A9m0F
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ECHO                                                     'A'
   18     1      > RETURN                                                   null

End of function foo

End of class A.

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

End of function b1

Function b2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A9m0F
function name:  b2
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'a1'
          2        DO_FCALL                                      0          
   32     3        INIT_STATIC_METHOD_CALL                                  'A', 'a2'
          4        DO_FCALL                                      0          
   33     5      > RETURN                                                   null

End of function b2

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A9m0F
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   ECHO                                                     'B'
   38     1      > RETURN                                                   null

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.1 ms | 1390 KiB | 13 Q