3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = array( "Home", "Pages" => array( "About", "Services", "Products", "Contact", "FAQs", "Sitemap", "Privacy Policy" ), "Column Layouts" => array( "1 Column", "2 Column (Left Sidebar)", "2 Column (Right Sidebar)", "3 Column", "4 Column" ) ); echo "<ul>"; function getMenu($array) { foreach($array as $key => $value) { if(is_array($value)) { echo "<li>" . $key . "</li>"; echo "<ul>"; getMenu($value); echo "</ul>"; } else { echo "<li>" . $value . "</li>"; } } } echo "</ul>"; getMenu($items);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RGvoa
function name:  (null)
number of ops:  7
compiled vars:  !0 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   22     1        ECHO                                                     '%3Cul%3E'
   35     2        ECHO                                                     '%3C%2Ful%3E'
   36     3        INIT_FCALL                                               'getmenu'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function getmenu:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/RGvoa
function name:  getMenu
number of ops:  21
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1      > FE_RESET_R                                       $3      !0, ->19
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->19
          3    >   ASSIGN                                                   !2, ~4
   25     4        TYPE_CHECK                                  128          !1
          5      > JMPZ                                                     ~6, ->15
   26     6    >   CONCAT                                           ~7      '%3Cli%3E', !2
          7        CONCAT                                           ~8      ~7, '%3C%2Fli%3E'
          8        ECHO                                                     ~8
   27     9        ECHO                                                     '%3Cul%3E'
   28    10        INIT_FCALL_BY_NAME                                       'getMenu'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   29    13        ECHO                                                     '%3C%2Ful%3E'
         14      > JMP                                                      ->18
   31    15    >   CONCAT                                           ~10     '%3Cli%3E', !1
         16        CONCAT                                           ~11     ~10, '%3C%2Fli%3E'
         17        ECHO                                                     ~11
   24    18    > > JMP                                                      ->2
         19    >   FE_FREE                                                  $3
   34    20      > RETURN                                                   null

End of function getmenu

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.99 ms | 1399 KiB | 14 Q