3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static $defaults = array( 'lifetime' => 0, 'path' => '/', 'domain' => '', 'secure' => false, 'httponly' => false, ); public static function initialize($options) { self::$defaults = self::$defaults + $options; } } var_dump(A::$defaults); A::initialize(array( 'lifetime' => 120, 'secure' => true, 'httponly' => true, )); var_dump(A::$defaults);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dg0YK
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'defaults'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   19     4        INIT_STATIC_METHOD_CALL                                  'A', 'initialize'
   20     5        SEND_VAL                                                 <array>
          6        DO_FCALL                                      0          
   24     7        INIT_FCALL                                               'var_dump'
          8        FETCH_STATIC_PROP_R          unknown             ~3      'defaults'
          9        SEND_VAL                                                 ~3
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class A:
Function initialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dg0YK
function name:  initialize
number of ops:  6
compiled vars:  !0 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        FETCH_STATIC_PROP_R          unknown             ~2      'defaults'
          2        ADD                                              ~3      ~2, !0
          3        ASSIGN_STATIC_PROP                                       'defaults'
          4        OP_DATA                                                  ~3
   15     5      > RETURN                                                   null

End of function initialize

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.82 ms | 1395 KiB | 15 Q