3v4l.org

run code in 300+ PHP versions simultaneously
<?php $NavMenu = [ 'The Green' => [ 'name' => 'The Green', 'subname' => 'Nice Color', 'href' => 'greenlink', 'title' => 'green is nature', 'icon' => 'globe', 'class' => 'green', 'subnav' => '' ], 'The Sun' => [ 'name' => 'The Sun', 'subname' => 'hot color', 'href' => 'yellowlink', 'title' => 'yellow is sun', 'icon' => 'sunicon', 'class' => 'yellow', 'subnav' => '' ], 'The Sky' => [ 'name' => 'The Sky', 'subname' => 'freedom', 'href' => 'bluelink', 'title' => 'blue is cold', 'icon' => 'free', 'class' => 'yellow', 'subnav' => [ 'name' => 'Free', 'href' => 'bluelinkFree', 'title' => 'freedom is love', 'class' => 'blueFreedom', 'icon' => 'love', 'subname' => 'love' ] ] ]; echo "<ul>"; foreach ($NavMenu as $navItem) { echo sprintf( '<li><a class="%s" href="%s" title="%s"><span icon="%s"></span>%s - %s</a>', $navItem["class"], $navItem["href"], $navItem["title"], $navItem["icon"], $navItem["name"], $navItem["subname"] ); if (is_array($navItem["subnav"])) { $subNavItem = $navItem["subnav"]; echo sprintf( '<ul><li><a class="%s" href="%s" title="%s"><span icon="%s"></span>%s - %s</a></li></ul>', $subNavItem["class"], $subNavItem["href"], $subNavItem["title"], $subNavItem["icon"], $subNavItem["name"], $subNavItem["subname"] ); } echo "</li>"; } echo "</ul>";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 43
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 43
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 41
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 41
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/COMqI
function name:  (null)
number of ops:  46
compiled vars:  !0 = $NavMenu, !1 = $navItem, !2 = $subNavItem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   45     1        ECHO                                                     '%3Cul%3E'
   46     2      > FE_RESET_R                                       $4      !0, ->43
          3    > > FE_FETCH_R                                               $4, !1, ->43
   47     4    >   INIT_FCALL                                               'sprintf'
   48     5        SEND_VAL                                                 '%3Cli%3E%3Ca+class%3D%22%25s%22+href%3D%22%25s%22+title%3D%22%25s%22%3E%3Cspan+icon%3D%22%25s%22%3E%3C%2Fspan%3E%25s+-+%25s%3C%2Fa%3E'
   49     6        FETCH_DIM_R                                      ~5      !1, 'class'
          7        SEND_VAL                                                 ~5
   50     8        FETCH_DIM_R                                      ~6      !1, 'href'
          9        SEND_VAL                                                 ~6
   51    10        FETCH_DIM_R                                      ~7      !1, 'title'
         11        SEND_VAL                                                 ~7
   52    12        FETCH_DIM_R                                      ~8      !1, 'icon'
         13        SEND_VAL                                                 ~8
   53    14        FETCH_DIM_R                                      ~9      !1, 'name'
         15        SEND_VAL                                                 ~9
   54    16        FETCH_DIM_R                                      ~10     !1, 'subname'
         17        SEND_VAL                                                 ~10
   47    18        DO_ICALL                                         $11     
   54    19        ECHO                                                     $11
   56    20        FETCH_DIM_R                                      ~12     !1, 'subnav'
         21        TYPE_CHECK                                  128          ~12
         22      > JMPZ                                                     ~13, ->41
   57    23    >   FETCH_DIM_R                                      ~14     !1, 'subnav'
         24        ASSIGN                                                   !2, ~14
   58    25        INIT_FCALL                                               'sprintf'
   59    26        SEND_VAL                                                 '%3Cul%3E%3Cli%3E%3Ca+class%3D%22%25s%22+href%3D%22%25s%22+title%3D%22%25s%22%3E%3Cspan+icon%3D%22%25s%22%3E%3C%2Fspan%3E%25s+-+%25s%3C%2Fa%3E%3C%2Fli%3E%3C%2Ful%3E'
   60    27        FETCH_DIM_R                                      ~16     !2, 'class'
         28        SEND_VAL                                                 ~16
   61    29        FETCH_DIM_R                                      ~17     !2, 'href'
         30        SEND_VAL                                                 ~17
   62    31        FETCH_DIM_R                                      ~18     !2, 'title'
         32        SEND_VAL                                                 ~18
   63    33        FETCH_DIM_R                                      ~19     !2, 'icon'
         34        SEND_VAL                                                 ~19
   64    35        FETCH_DIM_R                                      ~20     !2, 'name'
         36        SEND_VAL                                                 ~20
   65    37        FETCH_DIM_R                                      ~21     !2, 'subname'
         38        SEND_VAL                                                 ~21
   58    39        DO_ICALL                                         $22     
   65    40        ECHO                                                     $22
   68    41    >   ECHO                                                     '%3C%2Fli%3E'
   46    42      > JMP                                                      ->3
         43    >   FE_FREE                                                  $4
   70    44        ECHO                                                     '%3C%2Ful%3E'
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.25 ms | 1003 KiB | 14 Q