3v4l.org

run code in 300+ PHP versions simultaneously
<?php $GLOBALS['menus'] = array('randomarray', 'nothing'); echo 'firstarray<br>'; print_r($GLOBALS['menus']); // PRINTS THE CORRECT ARRAY class MENU{ public function getMenu($menutype){ echo 'secondarray<br>';print_r($GLOBALS['menus']); // PRINTS MENU Object ( ) switch($menutype){ case 'submenu': case 'sidemenu': /*foreach($GLOBALS['menus'][$menutype] as $menu => $menuitem){ foreach($menuitem as $menuattr => $menuval){ echo '<li><a href="'.$menuval['url'].'" class="'; if(isset($_GET['dir'])){ echo ($_GET['dir'] === $menu) ? 'active' : ''; }else{ echo isset($menuval['active']) ? 'active' : ''; } echo '"></a></li>'; } }*/ break; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D1SrZ
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $0      'menus'
          1        ASSIGN                                                   $0, <array>
    5     2        ECHO                                                     'firstarray%3Cbr%3E'
          3        INIT_FCALL                                               'print_r'
          4        FETCH_R                      global              ~2      'menus'
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
   28     7      > RETURN                                                   1

Class MENU:
Function getmenu:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 12, Position 2 = 12, Position 3 = 13, Position 4 = 7
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 13
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 12
Branch analysis from position: 12
filename:       /in/D1SrZ
function name:  getMenu
number of ops:  14
compiled vars:  !0 = $menutype
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ECHO                                                     'secondarray%3Cbr%3E'
          2        INIT_FCALL                                               'print_r'
          3        FETCH_R                      global              ~1      'menus'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   10     6      > SWITCH_STRING                                            !0, [ 'submenu':->12, 'sidemenu':->12, ], ->13
   11     7    >   IS_EQUAL                                                 !0, 'submenu'
          8      > JMPNZ                                                    ~3, ->12
   12     9    >   IS_EQUAL                                                 !0, 'sidemenu'
         10      > JMPNZ                                                    ~3, ->12
         11    > > JMP                                                      ->13
   25    12    > > JMP                                                      ->13
   27    13    > > RETURN                                                   null

End of function getmenu

End of class MENU.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.33 ms | 1001 KiB | 14 Q