3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Config { private $config = array( 'ip' => '127.0.0.1', 'port' => 12345 ); public function setting($option) { if (!empty($config[$option])) { return $config[$option]; } return false; } public function __invoke($option) { return $this->setting($option); } } $config = new Config(); var_dump($config('ip')); //127.0.0.1 ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fnt4G
function name:  (null)
number of ops:  10
compiled vars:  !0 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Config'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_FCALL                                               'var_dump'
          4        INIT_DYNAMIC_CALL                                        !0
          5        SEND_VAL_EX                                              'ip'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   22     9      > RETURN                                                   1

Class Config:
Function setting:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fnt4G
function name:  setting
number of ops:  8
compiled vars:  !0 = $option, !1 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ISSET_ISEMPTY_DIM_OBJ                         1  ~2      !1, !0
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPZ                                                     ~3, ->6
   10     4    >   FETCH_DIM_R                                      ~4      !1, !0
          5      > RETURN                                                   ~4
   12     6    > > RETURN                                                   <false>
   13     7*     > RETURN                                                   null

End of function setting

Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fnt4G
function name:  __invoke
number of ops:  6
compiled vars:  !0 = $option
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_METHOD_CALL                                         'setting'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   17     5*     > RETURN                                                   null

End of function __invoke

End of class Config.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.84 ms | 1396 KiB | 15 Q