3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { protected static $var = 'a'; public static function out(){ return self::$var;//здесь по правильному должен стоять static если мы хотим вывести данные наследника } } class b extends a { public static function init() { self::$var = 'b'; } } b::init(); echo a::out();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OXa0G
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'b', 'init'
          1        DO_FCALL                                      0          
   17     2        INIT_STATIC_METHOD_CALL                                  'a', 'out'
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
          5      > RETURN                                                   1

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

End of function out

End of class a.

Class b:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OXa0G
function name:  init
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN_STATIC_PROP                                       'var'
          1        OP_DATA                                                  'b'
   14     2      > RETURN                                                   null

End of function init

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

End of function out

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.18 ms | 1394 KiB | 13 Q