3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Settings{ protected static $settings = []; //in reality you load an ini file, or a php file or whatever. public static function load(){ self::$settings = [ 'db_user' => 'xantius', ]; } public static function get($key){ return self::$settings[$key]; } } //somewhere at initialization: Settings::load(); //and then anywhere: echo Settings::get('db_user');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Ji0o
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'Settings', 'load'
          1        DO_FCALL                                      0          
   22     2        INIT_STATIC_METHOD_CALL                                  'Settings', 'get'
          3        SEND_VAL                                                 'db_user'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
          6      > RETURN                                                   1

Class Settings:
Function load:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Ji0o
function name:  load
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_STATIC_PROP                                       'settings'
    9     1        OP_DATA                                                  <array>
   11     2      > RETURN                                                   null

End of function load

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Ji0o
function name:  get
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        FETCH_STATIC_PROP_R          unknown             ~1      'settings'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   15     4*     > RETURN                                                   null

End of function get

End of class Settings.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.05 ms | 1393 KiB | 13 Q