3v4l.org

run code in 300+ PHP versions simultaneously
<?php function loop($array) { echo '<ol class="dd-list">'; echo "\n"; foreach ( $array as $key => $value ) { echo '<li class="dd-item" data-id="' . $key . '">'; if(is_array($value)) { loop($value); } else { echo '<div class="dd-handle">' . $key . ' => ' . $value . '</div>'; } echo '</li>'; echo "\n"; } echo '</ol>'; } $testArray = array('1', '2', array('3', '4')); loop($testArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ahiI9
function name:  (null)
number of ops:  5
compiled vars:  !0 = $testArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, <array>
   20     1        INIT_FCALL                                               'loop'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function loop:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 23
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 23
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/ahiI9
function name:  loop
number of ops:  26
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     '%3Col+class%3D%22dd-list%22%3E'
    5     2        ECHO                                                     '%0A'
    6     3      > FE_RESET_R                                       $3      !0, ->23
          4    > > FE_FETCH_R                                       ~4      $3, !1, ->23
          5    >   ASSIGN                                                   !2, ~4
    7     6        CONCAT                                           ~6      '%3Cli+class%3D%22dd-item%22+data-id%3D%22', !2
          7        CONCAT                                           ~7      ~6, '%22%3E'
          8        ECHO                                                     ~7
    8     9        TYPE_CHECK                                  128          !1
         10      > JMPZ                                                     ~8, ->15
    9    11    >   INIT_FCALL_BY_NAME                                       'loop'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
         14      > JMP                                                      ->20
   11    15    >   CONCAT                                           ~10     '%3Cdiv+class%3D%22dd-handle%22%3E', !2
         16        CONCAT                                           ~11     ~10, '+%3D%3E+'
         17        CONCAT                                           ~12     ~11, !1
         18        CONCAT                                           ~13     ~12, '%3C%2Fdiv%3E'
         19        ECHO                                                     ~13
   13    20    >   ECHO                                                     '%3C%2Fli%3E'
   14    21        ECHO                                                     '%0A'
    6    22      > JMP                                                      ->4
         23    >   FE_FREE                                                  $3
   16    24        ECHO                                                     '%3C%2Fol%3E'
   17    25      > RETURN                                                   null

End of function loop

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.63 ms | 1402 KiB | 14 Q