3v4l.org

run code in 300+ PHP versions simultaneously
<?php function outputListItems($char) { static $index = array('A' => 1); if (!isset($index[$char])) { $index[$char] = 1; } for ($i = 0; $i < 3; $i++) { echo '<li>'; echo $char; echo $index[$char]++; if ($char <= 'C') { echo '<ul>'; $nextChar = $char; outputListItems(++$nextChar); echo '</ul>'; } echo '</li>'; } } ?> <ul> <li> A1 <ul><?php outputListItems('B'); ?></ul> </li> </ul>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAYQb
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   ECHO                                                     '%0A%3Cul%3E%0A++++%3Cli%3E%0A++++++++A1%0A++++++++%3Cul%3E'
   31     1        INIT_FCALL                                               'outputlistitems'
          2        SEND_VAL                                                 'B'
          3        DO_FCALL                                      0          
          4        ECHO                                                     '%3C%2Ful%3E%0A++++%3C%2Fli%3E%0A%3C%2Ful%3E'
   33     5      > RETURN                                                   1

Function outputlistitems:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 9
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 9
Branch analysis from position: 27
Branch analysis from position: 9
Branch analysis from position: 23
Branch analysis from position: 7
filename:       /in/DAYQb
function name:  outputListItems
number of ops:  28
compiled vars:  !0 = $char, !1 = $index, !2 = $i, !3 = $nextChar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        BIND_STATIC                                              !1
    6     2        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      !1, !0
          3        BOOL_NOT                                         ~5      ~4
          4      > JMPZ                                                     ~5, ->7
    7     5    >   ASSIGN_DIM                                               !1, !0
          6        OP_DATA                                                  1
   10     7    >   ASSIGN                                                   !2, 0
          8      > JMP                                                      ->25
   11     9    >   ECHO                                                     '%3Cli%3E'
   12    10        ECHO                                                     !0
   13    11        FETCH_DIM_RW                                     $8      !1, !0
         12        POST_INC                                         ~9      $8
         13        ECHO                                                     ~9
   15    14        IS_SMALLER_OR_EQUAL                                      !0, 'C'
         15      > JMPZ                                                     ~10, ->23
   16    16    >   ECHO                                                     '%3Cul%3E'
   17    17        ASSIGN                                                   !3, !0
   18    18        INIT_FCALL_BY_NAME                                       'outputListItems'
         19        PRE_INC                                          ~12     !3
         20        SEND_VAL_EX                                              ~12
         21        DO_FCALL                                      0          
   19    22        ECHO                                                     '%3C%2Ful%3E'
   22    23    >   ECHO                                                     '%3C%2Fli%3E'
   10    24        PRE_INC                                                  !2
         25    >   IS_SMALLER                                               !2, 3
         26      > JMPNZ                                                    ~15, ->9
   24    27    > > RETURN                                                   null

End of function outputlistitems

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.19 ms | 1402 KiB | 14 Q