3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = array(array(1, 'Ana Sayfa', '#', 0, 1), array(2, 'Tutorials', '#', 0, 1), array(3, 'Java', 'java', 6, 1), array(4, 'Liferay', 'liferay', 3, 1), array(5, 'Frameworks', '#', 0, 1), array(6, 'JSF', 'jsf', 5, 1), array(7, 'Struts', 'struts', 5, 1), array(8, 'Spring', 'spring', 6, 1), array(9, 'Hibernate', 'hibernate', 6, 1), array(10, 'Webservices', '#', 0, 1), array(11, 'REST', 'rest', 10, 1), array(12, 'SOAP', 'soap', 10, 1), array(13, 'Contact', 'contact', 0, 1), array(14, 'About', 'about', 0, 1), array(15, 'TEST-TEST-TEST', 'test', 5, 1), array(16, 'TEST2', 'test2', 15, 1)); foreach ($rows as $row) { $items[] = array_combine(array('cat_id', 'cat_name', 'seo_url', 'parent_id', 'place'), $row); } echo "<ul>"; foreach($items as $item){ if($item['parent_id'] == 0){ echo "<li>".$item['cat_name']; $id = $item['cat_id']; sub($items, $id); echo "</li>"; } } echo "</ul>"; function sub($items, $id){ echo "<ul>"; foreach($items as $item){ if($item['parent_id'] == $id){ echo "<li>".$item['cat_name']; sub($items, $item['cat_id']); echo "</li>"; } } echo "</ul>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 28
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 10
filename:       /in/HPP3s
function name:  (null)
number of ops:  31
compiled vars:  !0 = $rows, !1 = $row, !2 = $items, !3 = $item, !4 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   19     1      > FE_RESET_R                                       $6      !0, ->10
          2    > > FE_FETCH_R                                               $6, !1, ->10
   20     3    >   INIT_FCALL                                               'array_combine'
          4        SEND_VAL                                                 <array>
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $8      
          7        ASSIGN_DIM                                               !2
          8        OP_DATA                                                  $8
   19     9      > JMP                                                      ->2
         10    >   FE_FREE                                                  $6
   23    11        ECHO                                                     '%3Cul%3E'
   24    12      > FE_RESET_R                                       $9      !2, ->28
         13    > > FE_FETCH_R                                               $9, !3, ->28
   25    14    >   FETCH_DIM_R                                      ~10     !3, 'parent_id'
         15        IS_EQUAL                                                 ~10, 0
         16      > JMPZ                                                     ~11, ->27
   26    17    >   FETCH_DIM_R                                      ~12     !3, 'cat_name'
         18        CONCAT                                           ~13     '%3Cli%3E', ~12
         19        ECHO                                                     ~13
   27    20        FETCH_DIM_R                                      ~14     !3, 'cat_id'
         21        ASSIGN                                                   !4, ~14
   28    22        INIT_FCALL_BY_NAME                                       'sub'
         23        SEND_VAR_EX                                              !2
         24        SEND_VAR_EX                                              !4
         25        DO_FCALL                                      0          
   29    26        ECHO                                                     '%3C%2Fli%3E'
   24    27    > > JMP                                                      ->13
         28    >   FE_FREE                                                  $9
   32    29        ECHO                                                     '%3C%2Ful%3E'
   44    30      > RETURN                                                   1

Function sub:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/HPP3s
function name:  sub
number of ops:  22
compiled vars:  !0 = $items, !1 = $id, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   35     2        ECHO                                                     '%3Cul%3E'
   36     3      > FE_RESET_R                                       $3      !0, ->19
          4    > > FE_FETCH_R                                               $3, !2, ->19
   37     5    >   FETCH_DIM_R                                      ~4      !2, 'parent_id'
          6        IS_EQUAL                                                 !1, ~4
          7      > JMPZ                                                     ~5, ->18
   38     8    >   FETCH_DIM_R                                      ~6      !2, 'cat_name'
          9        CONCAT                                           ~7      '%3Cli%3E', ~6
         10        ECHO                                                     ~7
   39    11        INIT_FCALL_BY_NAME                                       'sub'
         12        SEND_VAR_EX                                              !0
         13        CHECK_FUNC_ARG                                           
         14        FETCH_DIM_FUNC_ARG                               $8      !2, 'cat_id'
         15        SEND_FUNC_ARG                                            $8
         16        DO_FCALL                                      0          
   40    17        ECHO                                                     '%3C%2Fli%3E'
   36    18    > > JMP                                                      ->4
         19    >   FE_FREE                                                  $3
   43    20        ECHO                                                     '%3C%2Ful%3E'
   44    21      > RETURN                                                   null

End of function sub

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.62 ms | 1007 KiB | 14 Q