3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myDirectory = opendir("."); // get each entry while($entryName = readdir($myDirectory)) { $dirArray[] = $entryName; } // close directory closedir($myDirectory); // count elements in array $indexCount = count($dirArray); Print ("$indexCount files<br>\n"); // sort 'em sort($dirArray); // print 'em print("<TABLE border=1 cellpadding=5 cellspacing=0 class=whitelinks>\n"); print("<TR><TH>Filename</TH><th>Filetype</th><th>Filesize</th></TR>\n"); // loop through the array of files and print them all for($index=0; $index < $indexCount; $index++) { if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files print("<TR><TD><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>"); print("<td>"); print(filetype($dirArray[$index])); print("</td>"); print("<td>"); print(filesize($dirArray[$index])); print("</td>"); print("</TR>\n"); } } print("</TABLE>\n"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 5
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 27
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 59
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 27
Branch analysis from position: 62
Branch analysis from position: 27
Branch analysis from position: 59
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 5
Branch analysis from position: 12
Branch analysis from position: 5
filename:       /in/XESpk
function name:  (null)
number of ops:  64
compiled vars:  !0 = $myDirectory, !1 = $dirArray, !2 = $entryName, !3 = $indexCount, !4 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'opendir'
          1        SEND_VAL                                                 '.'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    5     4      > JMP                                                      ->7
    6     5    >   ASSIGN_DIM                                               !1
          6        OP_DATA                                                  !2
    5     7    >   INIT_FCALL                                               'readdir'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                           ~9      !2, $8
         11      > JMPNZ                                                    ~9, ->5
   10    12    >   INIT_FCALL                                               'closedir'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   13    15        COUNT                                            ~11     !1
         16        ASSIGN                                                   !3, ~11
   14    17        NOP                                                      
         18        FAST_CONCAT                                      ~13     !3, '+files%3Cbr%3E%0A'
         19        ECHO                                                     ~13
   17    20        INIT_FCALL                                               'sort'
         21        SEND_REF                                                 !1
         22        DO_ICALL                                                 
   20    23        ECHO                                                     '%3CTABLE+border%3D1+cellpadding%3D5+cellspacing%3D0+class%3Dwhitelinks%3E%0A'
   21    24        ECHO                                                     '%3CTR%3E%3CTH%3EFilename%3C%2FTH%3E%3Cth%3EFiletype%3C%2Fth%3E%3Cth%3EFilesize%3C%2Fth%3E%3C%2FTR%3E%0A'
   23    25        ASSIGN                                                   !4, 0
         26      > JMP                                                      ->60
   24    27    >   INIT_FCALL                                               'substr'
         28        FETCH_DIM_R                                      ~16     !1, !4
         29        CAST                                          6  ~17     ~16
         30        SEND_VAL                                                 ~17
         31        SEND_VAL                                                 0
         32        SEND_VAL                                                 1
         33        DO_ICALL                                         $18     
         34        IS_NOT_EQUAL                                             $18, '.'
         35      > JMPZ                                                     ~19, ->59
   25    36    >   ROPE_INIT                                     5  ~23     '%3CTR%3E%3CTD%3E%3Ca+href%3D%22'
         37        FETCH_DIM_R                                      ~20     !1, !4
         38        ROPE_ADD                                      1  ~23     ~23, ~20
         39        ROPE_ADD                                      2  ~23     ~23, '%22%3E'
         40        FETCH_DIM_R                                      ~21     !1, !4
         41        ROPE_ADD                                      3  ~23     ~23, ~21
         42        ROPE_END                                      4  ~22     ~23, '%3C%2Fa%3E%3C%2Ftd%3E'
         43        ECHO                                                     ~22
   26    44        ECHO                                                     '%3Ctd%3E'
   27    45        INIT_FCALL                                               'filetype'
         46        FETCH_DIM_R                                      ~26     !1, !4
         47        SEND_VAL                                                 ~26
         48        DO_ICALL                                         $27     
         49        ECHO                                                     $27
   28    50        ECHO                                                     '%3C%2Ftd%3E'
   29    51        ECHO                                                     '%3Ctd%3E'
   30    52        INIT_FCALL                                               'filesize'
         53        FETCH_DIM_R                                      ~28     !1, !4
         54        SEND_VAL                                                 ~28
         55        DO_ICALL                                         $29     
         56        ECHO                                                     $29
   31    57        ECHO                                                     '%3C%2Ftd%3E'
   32    58        ECHO                                                     '%3C%2FTR%3E%0A'
   23    59    >   PRE_INC                                                  !4
         60    >   IS_SMALLER                                               !4, !3
         61      > JMPNZ                                                    ~31, ->27
   35    62    >   ECHO                                                     '%3C%2FTABLE%3E%0A'
   36    63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.94 ms | 1400 KiB | 27 Q