3v4l.org

run code in 300+ PHP versions simultaneously
<?php function config( $key = null ){ // $config = parse_ini_file('../out_of_root/app.ini'); $config = []; $config['base_url'] = '/mypath/'; if ( is_null($key) ){ return $config; } else if ( array_key_exists($key, $config) ) { return $config[$key]; } else { return "key doesn't exist"; } } class myclass{ public function myfunc(){ echo config('base_url'); } } $obj = new myclass; $obj->myfunc();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RW0fV
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'myclass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'myfunc'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function config:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RW0fV
function name:  config
number of ops:  15
compiled vars:  !0 = $key, !1 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      null
    6     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN_DIM                                               !1, 'base_url'
          3        OP_DATA                                                  '%2Fmypath%2F'
    9     4        TYPE_CHECK                                    2          !0
          5      > JMPZ                                                     ~4, ->8
   10     6    > > RETURN                                                   !1
    9     7*       JMP                                                      ->14
   11     8    >   ARRAY_KEY_EXISTS                                         !0, !1
          9      > JMPZ                                                     ~5, ->13
   12    10    >   FETCH_DIM_R                                      ~6      !1, !0
         11      > RETURN                                                   ~6
   11    12*       JMP                                                      ->14
   14    13    > > RETURN                                                   'key+doesn%27t+exist'
   16    14*     > RETURN                                                   null

End of function config

Class myclass:
Function myfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RW0fV
function name:  myfunc
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'config'
          1        SEND_VAL                                                 'base_url'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   22     4      > RETURN                                                   null

End of function myfunc

End of class myclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.63 ms | 1004 KiB | 14 Q