3v4l.org

run code in 300+ PHP versions simultaneously
<?php function listFolderFiles($dir){ $ffs = scandir($dir); unset($ffs[array_search('.', $ffs, true)]); unset($ffs[array_search('..', $ffs, true)]); // prevent empty ordered elements if (count($ffs) < 1) return; echo '<ol>'; foreach($ffs as $ff){ echo '<li>'.$ff; if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff); echo '</li>'; } echo '</ol>'; } listFolderFiles('./');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VsQLb
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'listfolderfiles'
          1        SEND_VAL                                                 '.%2F'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function listfolderfiles:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 39
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 39
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 37
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 37
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/VsQLb
function name:  listFolderFiles
number of ops:  42
compiled vars:  !0 = $dir, !1 = $ffs, !2 = $ff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'scandir'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
    5     5        INIT_FCALL                                               'array_search'
          6        SEND_VAL                                                 '.'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $5      
         10        UNSET_DIM                                                !1, $5
    6    11        INIT_FCALL                                               'array_search'
         12        SEND_VAL                                                 '..'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $6      
         16        UNSET_DIM                                                !1, $6
    9    17        COUNT                                            ~7      !1
         18        IS_SMALLER                                               ~7, 1
         19      > JMPZ                                                     ~8, ->21
   10    20    > > RETURN                                                   null
   12    21    >   ECHO                                                     '%3Col%3E'
   13    22      > FE_RESET_R                                       $9      !1, ->39
         23    > > FE_FETCH_R                                               $9, !2, ->39
   14    24    >   CONCAT                                           ~10     '%3Cli%3E', !2
         25        ECHO                                                     ~10
   15    26        INIT_FCALL                                               'is_dir'
         27        CONCAT                                           ~11     !0, '%2F'
         28        CONCAT                                           ~12     ~11, !2
         29        SEND_VAL                                                 ~12
         30        DO_ICALL                                         $13     
         31      > JMPZ                                                     $13, ->37
         32    >   INIT_FCALL_BY_NAME                                       'listFolderFiles'
         33        CONCAT                                           ~14     !0, '%2F'
         34        CONCAT                                           ~15     ~14, !2
         35        SEND_VAL_EX                                              ~15
         36        DO_FCALL                                      0          
   16    37    >   ECHO                                                     '%3C%2Fli%3E'
   13    38      > JMP                                                      ->23
         39    >   FE_FREE                                                  $9
   18    40        ECHO                                                     '%3C%2Fol%3E'
   19    41      > RETURN                                                   null

End of function listfolderfiles

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.5 ms | 1403 KiB | 20 Q