3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { static public $a=2; static public function geta() { return static::$a; } } class B extends A { static public $a; static public function seta($a ) { self::$a = $a; } } class C extends A { } B::seta(1); echo C::geta() . "\n"; echo (new B)->geta();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/THQMB
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'seta'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0          
   28     3        INIT_STATIC_METHOD_CALL                                  'C', 'geta'
          4        DO_FCALL                                      0  $1      
          5        CONCAT                                           ~2      $1, '%0A'
          6        ECHO                                                     ~2
   29     7        NEW                                              $3      'B'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $3, 'geta'
         10        DO_FCALL                                      0  $5      
         11        ECHO                                                     $5
         12      > RETURN                                                   1

Class A:
Function geta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/THQMB
function name:  geta
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'a'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function geta

End of class A.

Class B:
Function seta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/THQMB
function name:  seta
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        ASSIGN_STATIC_PROP                                       'a'
          2        OP_DATA                                                  !0
   19     3      > RETURN                                                   null

End of function seta

Function geta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/THQMB
function name:  geta
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'a'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function geta

End of class B.

Class C:
Function geta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/THQMB
function name:  geta
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'a'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function geta

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.41 ms | 1399 KiB | 13 Q