3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { public $_themeMap = array( "microsite" => array( "toc" => "microsite", "global-ui" => "microsite" ) ); public function getTOCFromTheme($theme) { if(array_key_exists($theme, $this->_themeMap) && array_key_exists("toc", $this->_themeMap[$theme])) { return $this->$themeMap[$theme]["toc"]; } else { return "default"; } } } echo (new TestClass)->getTOCFromTheme('microsite'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9VZuj
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $0      'TestClass'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'getTOCFromTheme'
          3        SEND_VAL_EX                                              'microsite'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
   23     6      > RETURN                                                   1

Class TestClass:
Function gettocfromtheme:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/9VZuj
function name:  getTOCFromTheme
number of ops:  16
compiled vars:  !0 = $theme, !1 = $themeMap
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        FETCH_OBJ_R                                      ~2      '_themeMap'
          2        ARRAY_KEY_EXISTS                                 ~3      !0, ~2
          3      > JMPZ_EX                                          ~3      ~3, ->8
          4    >   FETCH_OBJ_R                                      ~4      '_themeMap'
          5        FETCH_DIM_R                                      ~5      ~4, !0
          6        ARRAY_KEY_EXISTS                                 ~6      'toc', ~5
          7        BOOL                                             ~3      ~6
          8    > > JMPZ                                                     ~3, ->14
   15     9    >   FETCH_OBJ_R                                      ~7      !1
         10        FETCH_DIM_R                                      ~8      ~7, !0
         11        FETCH_DIM_R                                      ~9      ~8, 'toc'
         12      > RETURN                                                   ~9
         13*       JMP                                                      ->15
   17    14    > > RETURN                                                   'default'
   19    15*     > RETURN                                                   null

End of function gettocfromtheme

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.18 ms | 1395 KiB | 13 Q