3v4l.org

run code in 300+ PHP versions simultaneously
<?php $navigation = array( array( "title" => "Overzicht", "enabled" => 1, "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" => 1 ), 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 $k => $v) { if (isset($v["userlevel"])) { if (($v["userlevel"] < 60)) unset($arr[$k]); } if (isset($v["submenu"])) { $filterFunc($v["submenu"]); } } }; $filterFunc($navigation); var_dump($navigation);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mrlBP
function name:  (null)
number of ops:  11
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%2FmrlBP%3A59%240'
          2        BIND_LEXICAL                                             ~3, !1
          3        ASSIGN                                                   !1, ~3
   71     4        INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   73     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FmrlBP%3A59%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
Branch analysis from position: 11
Branch analysis from position: 11
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/mrlBP
function name:  {closure}
number of ops:  21
compiled vars:  !0 = $arr, !1 = $filterFunc, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   60     2      > FE_RESET_R                                       $4      !0, ->19
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->19
          4    >   ASSIGN                                                   !3, ~5
   61     5        ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'userlevel'
          6      > JMPZ                                                     ~7, ->11
   62     7    >   FETCH_DIM_R                                      ~8      !2, 'userlevel'
          8        IS_SMALLER                                               ~8, 60
          9      > JMPZ                                                     ~9, ->11
   63    10    >   UNSET_DIM                                                !0, !3
   65    11    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'submenu'
         12      > JMPZ                                                     ~10, ->18
   66    13    >   INIT_DYNAMIC_CALL                                        !1
         14        CHECK_FUNC_ARG                                           
         15        FETCH_DIM_FUNC_ARG                               $11     !2, 'submenu'
         16        SEND_FUNC_ARG                                            $11
         17        DO_FCALL                                      0          
   60    18    > > JMP                                                      ->3
         19    >   FE_FREE                                                  $4
   69    20      > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.75 ms | 1400 KiB | 15 Q