3v4l.org

run code in 300+ PHP versions simultaneously
<?php $navigation = array( array( "title" => "Overzicht", "enabled" => 0, "submenu" => array( array( "title" => "Dashboard", "url" => "dashboard/", "module" => "Home", "icon" => "icon-home", "userlevel" => 0, "enabled" => 1 ), array( "title" => "Mijn statistieken", "url" => "user/stats/", "module" => "User", "icon" => "icon-stats", "userlevel" => 60, "enabled" => 1 ) ) ), array( "title" => "Acties", "enabled" => 1, "submenu" => array( array( "title" => "Alle acties", "url" => "action/", "module" => "Action", "icon" => "icon-list-alt", "userlevel" => 0, "enabled" => 0 ), array( "title" => "Mijn acties", "url" => "action/:user_id/", "module" => "Action", "icon" => "icon-list", "userlevel" => 60, "enabled" => 1 ), array( "title" => "Nieuwe actie", "url" => "new/", "module" => "Action", "icon" => "icon-plus", "userlevel" => 80, "enabled" => 1 ) ) ) ); $filterFunc = function($v) use (&$filterFunc) { if (!$v["enabled"]) return false; if (isset($v["userlevel"])) { if ($v["userlevel"] > 60) return false; } var_dump(isset($v["submenu"])); if (isset($v["submenu"])) { return array_filter($v["submenu"], $filterFunc); } return true; }; $navigation = array_filter($navigation, $filterFunc); var_dump($navigation);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZPvQG
function name:  (null)
number of ops:  13
compiled vars:  !0 = $navigation, !1 = $filterFunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   59     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZPvQG%3A59%240'
          2        BIND_LEXICAL                                             ~3, !1
          3        ASSIGN                                                   !1, ~3
   77     4        INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !0, $5
   79     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZPvQG%3A59%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/ZPvQG
function name:  {closure}
number of ops:  26
compiled vars:  !0 = $v, !1 = $filterFunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   60     2        FETCH_DIM_R                                      ~2      !0, 'enabled'
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->6
   61     5    > > RETURN                                                   <false>
   63     6    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'userlevel'
          7      > JMPZ                                                     ~4, ->12
   64     8    >   FETCH_DIM_R                                      ~5      !0, 'userlevel'
          9        IS_SMALLER                                               60, ~5
         10      > JMPZ                                                     ~6, ->12
   65    11    > > RETURN                                                   <false>
   68    12    >   INIT_FCALL                                               'var_dump'
         13        ISSET_ISEMPTY_DIM_OBJ                         0  ~7      !0, 'submenu'
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                                 
   70    16        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'submenu'
         17      > JMPZ                                                     ~9, ->24
   71    18    >   INIT_FCALL                                               'array_filter'
         19        FETCH_DIM_R                                      ~10     !0, 'submenu'
         20        SEND_VAL                                                 ~10
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $11     
         23      > RETURN                                                   $11
   74    24    > > RETURN                                                   <true>
   75    25*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZPvQG%3A59%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.69 ms | 1400 KiB | 17 Q