3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { protected static $foo = array(); public static function foo(){ var_dump(self::$foo); } public static function bar(){ self::$foo[] = 'foo'; } } class b extends a{ public static function foo(){ self::$foo[] = 'bar'; } } a::foo(); a::bar(); a::foo(); b::foo(); a::foo(); var_dump(b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/grXFW
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                  'a', 'foo'
          1        DO_FCALL                                      0          
   19     2        INIT_STATIC_METHOD_CALL                                  'a', 'bar'
          3        DO_FCALL                                      0          
   21     4        INIT_STATIC_METHOD_CALL                                  'a', 'foo'
          5        DO_FCALL                                      0          
   22     6        INIT_STATIC_METHOD_CALL                                  'b', 'foo'
          7        DO_FCALL                                      0          
   24     8        INIT_STATIC_METHOD_CALL                                  'a', 'foo'
          9        DO_FCALL                                      0          
   26    10        INIT_FCALL                                               'var_dump'
         11        FETCH_CONSTANT                                   ~5      'b'
         12        SEND_VAL                                                 ~5
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class a:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/grXFW
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'foo'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    6     4      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/grXFW
function name:  bar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_W          global              $0      'foo'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'foo'
    9     3      > RETURN                                                   null

End of function bar

End of class a.

Class b:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/grXFW
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_STATIC_PROP_W          global              $0      'foo'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'bar'
   15     3      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/grXFW
function name:  bar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_W          global              $0      'foo'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'foo'
    9     3      > RETURN                                                   null

End of function bar

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.68 ms | 1400 KiB | 15 Q