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; } if (isset($v["submenu"])) { $v["submenu"] = array_filter($v["submenu"], $filterFunc); } return true; }; var_dump(array_filter($navigation, $filterFunc));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f2kvZ
function name:  (null)
number of ops:  12
compiled vars:  !0 = $navigation, !1 = $filterFunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   58     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ff2kvZ%3A58%240'
          2        BIND_LEXICAL                                             ~3, !1
          3        ASSIGN                                                   !1, ~3
   74     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'array_filter'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ff2kvZ%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
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 12
filename:       /in/f2kvZ
function name:  {closure}
number of ops:  23
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    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'submenu'
         13      > JMPZ                                                     ~7, ->21
   68    14    >   INIT_FCALL                                               'array_filter'
         15        FETCH_DIM_R                                      ~9      !0, 'submenu'
         16        SEND_VAL                                                 ~9
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $10     
         19        ASSIGN_DIM                                               !0, 'submenu'
         20        OP_DATA                                                  $10
   71    21    > > RETURN                                                   <true>
   72    22*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.5 ms | 1400 KiB | 17 Q