3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Registry { public static $user; public static $DB; public static $config; public static $user_data; private static $initialized = FALSE; public static function init($config) { if (!registry::$initialized) { registry::$config = $config; registry::$DB = new db($config['mysql']); registry::$user = new user(); registry::$initialized = TRUE; } else { throw new Exception('Registry has already been initialized.'); } } } $a = Registry;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SnnmE
function name:  (null)
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   FETCH_CONSTANT                                   ~1      'Registry'
          1        ASSIGN                                                   !0, ~1
          2      > RETURN                                                   1

Class Registry:
Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/SnnmE
function name:  init
number of ops:  25
compiled vars:  !0 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        FETCH_STATIC_PROP_R          unknown             ~1      'initialized'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->20
   13     4    >   ASSIGN_STATIC_PROP                                       'config', 'registry'
          5        OP_DATA                                                  !0
   14     6        NEW                                              $5      'db'
          7        CHECK_FUNC_ARG                                           
          8        FETCH_DIM_FUNC_ARG                               $6      !0, 'mysql'
          9        SEND_FUNC_ARG                                            $6
         10        DO_FCALL                                      0          
         11        ASSIGN_STATIC_PROP                                       'DB', 'registry'
         12        OP_DATA                                                  $5
   15    13        NEW                                              $9      'user'
         14        DO_FCALL                                      0          
         15        ASSIGN_STATIC_PROP                                       'user', 'registry'
         16        OP_DATA                                                  $9
   16    17        ASSIGN_STATIC_PROP                                       'initialized', 'registry'
         18        OP_DATA                                                  <true>
         19      > JMP                                                      ->24
   18    20    >   NEW                                              $12     'Exception'
         21        SEND_VAL_EX                                              'Registry+has+already+been+initialized.'
         22        DO_FCALL                                      0          
         23      > THROW                                         0          $12
   20    24    > > RETURN                                                   null

End of function init

End of class Registry.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.64 ms | 1399 KiB | 13 Q