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; } return true; }; foreach($navigation as &$v) { $v = array_filter($v, $filterFunc); } var_dump(array_filter($navigation, $filterFunc));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 126) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/VkHkW
function name:  (null)
number of ops:  21
compiled vars:  !0 = $navigation, !1 = $filterFunc, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   58     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVkHkW%3A58%240'
          2        BIND_LEXICAL                                             ~4, !1
          3        ASSIGN                                                   !1, ~4
   70     4      > FE_RESET_RW                                      $6      !0, ->12
          5    > > FE_FETCH_RW                                              $6, !2, ->12
   71     6    >   INIT_FCALL                                               'array_filter'
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
   70    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $6
   74    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'array_filter'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVkHkW%3A58%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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/VkHkW
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $v, !1 = $filterFunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   59     2        FETCH_DIM_R                                      ~2      !0, 'enabled'
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->6
   60     5    > > RETURN                                                   <false>
   62     6    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'userlevel'
          7      > JMPZ                                                     ~4, ->12
   63     8    >   FETCH_DIM_R                                      ~5      !0, 'userlevel'
          9        IS_SMALLER                                               60, ~5
         10      > JMPZ                                                     ~6, ->12
   64    11    > > RETURN                                                   <false>
   67    12    > > RETURN                                                   <true>
   68    13*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVkHkW%3A58%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.58 ms | 1400 KiB | 17 Q