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($arr) use (&$filterFunc) { foreach ($arr as &$v) { if (!$v["enabled"]) unset($v); if (isset($v["userlevel"])) { if (($v["userlevel"] > 60)) unset($v); } if (isset($v["submenu"])) { $v["submenu"] = $filterFunc($v["submenu"]); } } return $arr; }; $navigation = $filterFunc($navigation); var_dump($navigation);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4SYUT
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>
   59     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4SYUT%3A59%240'
          2        BIND_LEXICAL                                             ~3, !1
          3        ASSIGN                                                   !1, ~3
   76     4        INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !0, $5
   78     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4SYUT%3A59%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
Branch analysis from position: 14
Branch analysis from position: 14
Branch analysis from position: 8
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/4SYUT
function name:  {closure}
number of ops:  27
compiled vars:  !0 = $arr, !1 = $filterFunc, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   60     2      > FE_RESET_RW                                      $3      !0, ->24
          3    > > FE_FETCH_RW                                              $3, !2, ->24
   61     4    >   FETCH_DIM_R                                      ~4      !2, 'enabled'
          5        BOOL_NOT                                         ~5      ~4
          6      > JMPZ                                                     ~5, ->8
   62     7    >   UNSET_CV                                                 !2
   64     8    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'userlevel'
          9      > JMPZ                                                     ~6, ->14
   65    10    >   FETCH_DIM_R                                      ~7      !2, 'userlevel'
         11        IS_SMALLER                                               60, ~7
         12      > JMPZ                                                     ~8, ->14
   66    13    >   UNSET_CV                                                 !2
   68    14    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'submenu'
         15      > JMPZ                                                     ~9, ->23
   69    16    >   INIT_DYNAMIC_CALL                                        !1
         17        CHECK_FUNC_ARG                                           
         18        FETCH_DIM_FUNC_ARG                               $11     !2, 'submenu'
         19        SEND_FUNC_ARG                                            $11
         20        DO_FCALL                                      0  $12     
         21        ASSIGN_DIM                                               !2, 'submenu'
         22        OP_DATA                                                  $12
   60    23    > > JMP                                                      ->3
         24    >   FE_FREE                                                  $3
   73    25      > RETURN                                                   !0
   74    26*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.35 ms | 1400 KiB | 15 Q