3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public static $registered = array(); public static function register($name){ self::$registered[] = $name; } } class Child extends X { } Child::register("foo"); var_dump( Child::$registered );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M9BGZ
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'Child', 'register'
          1        SEND_VAL                                                 'foo'
          2        DO_FCALL                                      0          
   18     3        INIT_FCALL                                               'var_dump'
          4        FETCH_STATIC_PROP_R          unknown             ~1      'registered'
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class X:
Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M9BGZ
function name:  register
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_STATIC_PROP_W          global              $1      'registered'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
    8     4      > RETURN                                                   null

End of function register

End of class X.

Class Child:
Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M9BGZ
function name:  register
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_STATIC_PROP_W          global              $1      'registered'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
    8     4      > RETURN                                                   null

End of function register

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.45 ms | 1400 KiB | 15 Q