3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class A { protected static $val; public static function get() { return static::$val; } public static function set($val) { static::$val = $val; } } class B extends A { } B::set('b'); var_dump(B::get()); var_dump(A::get()); B::set('a'); var_dump(B::get()); var_dump(A::get());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPii7
function name:  (null)
number of ops:  27
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'set'
          1        SEND_VAL                                                 'b'
          2        DO_FCALL                                      0          
   24     3        INIT_FCALL                                               'var_dump'
          4        INIT_STATIC_METHOD_CALL                                  'B', 'get'
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
   25     8        INIT_FCALL                                               'var_dump'
          9        INIT_STATIC_METHOD_CALL                                  'A', 'get'
         10        DO_FCALL                                      0  $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                                 
   27    13        INIT_STATIC_METHOD_CALL                                  'B', 'set'
         14        SEND_VAL                                                 'a'
         15        DO_FCALL                                      0          
   29    16        INIT_FCALL                                               'var_dump'
         17        INIT_STATIC_METHOD_CALL                                  'B', 'get'
         18        DO_FCALL                                      0  $6      
         19        SEND_VAR                                                 $6
         20        DO_ICALL                                                 
   30    21        INIT_FCALL                                               'var_dump'
         22        INIT_STATIC_METHOD_CALL                                  'A', 'get'
         23        DO_FCALL                                      0  $8      
         24        SEND_VAR                                                 $8
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Class A:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPii7
function name:  get
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      'val'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function get

Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPii7
function name:  set
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        ASSIGN_STATIC_PROP                                       'val'
          2        OP_DATA                                                  !0
   15     3      > RETURN                                                   null

End of function set

End of class A.

Class B:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPii7
function name:  get
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      'val'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function get

Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPii7
function name:  set
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        ASSIGN_STATIC_PROP                                       'val'
          2        OP_DATA                                                  !0
   15     3      > RETURN                                                   null

End of function set

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.07 ms | 1400 KiB | 15 Q