3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Config { private static $config = array(); private function Get($name) { return static::$config[$name]; } public function Set($name, $value) { static::$config[$name] = $value; } } $c = new Config(); var_dump($c->set(1, 2)); Config::Set('xxx', 'yyy'); print(Config::Get('xxx')."\n");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07dZN
function name:  (null)
number of ops:  20
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Config'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'set'
          5        SEND_VAL_EX                                              1
          6        SEND_VAL_EX                                              2
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   18    10        INIT_STATIC_METHOD_CALL                                  'Config', 'Set'
         11        SEND_VAL                                                 'xxx'
         12        SEND_VAL                                                 'yyy'
         13        DO_FCALL                                      0          
   19    14        INIT_STATIC_METHOD_CALL                                  'Config', 'Get'
         15        SEND_VAL_EX                                              'xxx'
         16        DO_FCALL                                      0  $7      
         17        CONCAT                                           ~8      $7, '%0A'
         18        ECHO                                                     ~8
         19      > RETURN                                                   1

Class Config:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07dZN
function name:  Get
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_STATIC_PROP_R          unknown             ~1      'config'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
    8     4*     > RETURN                                                   null

End of function get

Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07dZN
function name:  Set
number of ops:  6
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        FETCH_STATIC_PROP_W          global              $2      'config'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   12     5      > RETURN                                                   null

End of function set

End of class Config.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.59 ms | 1396 KiB | 15 Q