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($item) use (&$filterFunc) { if (!$v["enabled"]) return false; if (isset($v["userlevel"])) { if (($v["userlevel"] > 60)) return false; } 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/1DfCt
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%2F1DfCt%3A59%240'
          2        BIND_LEXICAL                                             ~3, !1
          3        ASSIGN                                                   !1, ~3
   74     4        INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !0, $5
   76     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.25 ms | 1392 KiB | 17 Q