3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL | E_STRICT); 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/ZOGOA
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   19     3        INIT_STATIC_METHOD_CALL                                  'b', 'aa'
          4        DO_FCALL                                      0          
   21     5        INIT_FCALL                                               'var_dump'
          6        FETCH_STATIC_PROP_R          unknown             ~2      'hoge'
          7        SEND_VAL                                                 ~2
          8        FETCH_STATIC_PROP_R          unknown             ~3      'hoge'
          9        SEND_VAL                                                 ~3
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function aa

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.61 ms | 1387 KiB | 17 Q