3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class a { public static $hoge; public static function aa() { static::$hoge = new static; } } class b extends a { } b::aa(); var_dump(a::$hoge, b::$hoge);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nPa7G
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'b', 'aa'
          1        DO_FCALL                                      0          
   19     2        INIT_FCALL                                               'var_dump'
          3        FETCH_STATIC_PROP_R          unknown             ~1      'hoge'
          4        SEND_VAL                                                 ~1
          5        FETCH_STATIC_PROP_R          unknown             ~2      'hoge'
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class a:
Function aa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nPa7G
function name:  aa
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN_STATIC_PROP                                       'hoge'
          3        OP_DATA                                                  $1
    9     4      > RETURN                                                   null

End of function aa

End of class a.

Class b:
Function aa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nPa7G
function name:  aa
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN_STATIC_PROP                                       'hoge'
          3        OP_DATA                                                  $1
    9     4      > RETURN                                                   null

End of function aa

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 1395 KiB | 15 Q