3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ public static $def = array('head'=>array('a'=>'b'),'fields'=>array('a'=>'field_a','b'=>'field_b')); } class B extends A { public function __construct() { B::$def = array_merge(parrent::$def,array('fields'=>array('c'=>'field_c'))); } } var_dump(B::$def);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ODUlu
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'def'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
          4      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ODUlu
function name:  __construct
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'array_merge'
          1        FETCH_STATIC_PROP_R          unknown             ~1      'def'
          2        SEND_VAL                                                 ~1
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $2      
          5        ASSIGN_STATIC_PROP                                       'def', 'B'
          6        OP_DATA                                                  $2
   11     7      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.67 ms | 1394 KiB | 17 Q