3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Some file #1 */ /** * Using a class to orginize your commonly accessed variables has a few * benifits, one of which is being able to well document each variable. */ class my_vars { /** * Does this, this, and this. Is set in /path/file.ext */ public static $var1; /** * Does this, this, and this. Is set by my_vars::init() */ public static $var2; /** * Does this, this, and this. */ public static $var3 = 'baz'; /*** Methods ***/ /** * Sets up some of the variables values. Should be called at the end of this * file, or sometime later in the script. */ public static function init() { self::$var2 = 'bar'; } } my_vars::init(); /* Some (later) file #2 */ function my_func() { // do stuff my_vars::$var1 = 'foo'; // do stuff } my_func(); echo my_vars::$var1."\n"; echo my_vars::$var2."\n"; echo my_vars::$var3; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kSHpJ
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   INIT_STATIC_METHOD_CALL                                  'my_vars', 'init'
          1        DO_FCALL                                      0          
   52     2        INIT_FCALL                                               'my_func'
          3        DO_FCALL                                      0          
   55     4        FETCH_STATIC_PROP_R          unknown             ~2      'var1'
          5        CONCAT                                           ~3      ~2, '%0A'
          6        ECHO                                                     ~3
   56     7        FETCH_STATIC_PROP_R          unknown             ~4      'var2'
          8        CONCAT                                           ~5      ~4, '%0A'
          9        ECHO                                                     ~5
   57    10        FETCH_STATIC_PROP_R          unknown             ~6      'var3'
         11        ECHO                                                     ~6
   61    12      > RETURN                                                   1

Function my_func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kSHpJ
function name:  my_func
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   ASSIGN_STATIC_PROP                                       'var1', 'my_vars'
          1        OP_DATA                                                  'foo'
   50     2      > RETURN                                                   null

End of function my_func

Class my_vars:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kSHpJ
function name:  init
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   ASSIGN_STATIC_PROP                                       'var2'
          1        OP_DATA                                                  'bar'
   36     2      > RETURN                                                   null

End of function init

End of class my_vars.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.09 ms | 1398 KiB | 14 Q