3v4l.org

run code in 500+ PHP versions simultaneously
<?php $page_access = array( 'index' => array('1', '2', '3'), 'users' => array('4', '5', '6') ); function level_access($page){ global $page_access; if (array_key_exists($page, $page_access)) { echo "yes"; } else { echo "no"; } } level_access('index'); echo "\n"; function level_access2($page){ global $page_access; if (isset($page_access[$page])) { echo "yes"; } else { echo "no"; } } level_access2('index');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e2QMM
function name:  (null)
number of ops:  9
compiled vars:  !0 = $page_access
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   16     1        INIT_FCALL                                                   'level_access'
          2        SEND_VAL                                                     'index'
          3        DO_FCALL                                          0          
   17     4        ECHO                                                         '%0A'
   27     5        INIT_FCALL                                                   'level_access2'
          6        SEND_VAL                                                     'index'
          7        DO_FCALL                                          0          
          8      > RETURN                                                       1

Function level_access:
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 = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e2QMM
function name:  level_access
number of ops:  8
compiled vars:  !0 = $page, !1 = $page_access
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    8     1        BIND_GLOBAL                                                  !1, 'page_access'
    9     2        ARRAY_KEY_EXISTS                                             !0, !1
          3      > JMPZ                                                         ~2, ->6
   10     4    >   ECHO                                                         'yes'
    9     5      > JMP                                                          ->7
   12     6    >   ECHO                                                         'no'
   14     7    > > RETURN                                                       null

End of function level_access

Function level_access2:
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 = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e2QMM
function name:  level_access2
number of ops:  8
compiled vars:  !0 = $page, !1 = $page_access
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   19     1        BIND_GLOBAL                                                  !1, 'page_access'
   20     2        ISSET_ISEMPTY_DIM_OBJ                             0          !1, !0
          3      > JMPZ                                                         ~2, ->6
   21     4    >   ECHO                                                         'yes'
   20     5      > JMP                                                          ->7
   23     6    >   ECHO                                                         'no'
   25     7    > > RETURN                                                       null

End of function level_access2

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.73 ms | 2079 KiB | 15 Q