3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // open this directory $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
Jump found. Position 1 = 7
Branch analysis from position: 7
Jump found. Position 1 = 12, Position 2 = 5
Branch analysis from position: 12
Jump found. Position 1 = 63
Branch analysis from position: 63
Jump found. Position 1 = 65, Position 2 = 29
Branch analysis from position: 65
Jump found. Position 1 = -2
Branch analysis from position: 29
Jump found. Position 1 = 38, Position 2 = 61
Branch analysis from position: 38
Jump found. Position 1 = 65, Position 2 = 29
Branch analysis from position: 65
Branch analysis from position: 29
Branch analysis from position: 61
Branch analysis from position: 5
Jump found. Position 1 = 12, Position 2 = 5
Branch analysis from position: 12
Branch analysis from position: 5
filename:       /in/VTj2e
function name:  (null)
number of ops:  67
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                                                 '%2F'
         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        INIT_FCALL                                               'count'
        16        SEND_VAR                                                 !1
        17        DO_ICALL                                         $11     
        18        ASSIGN                                                   !3, $11
  14    19        NOP                                                      
        20        FAST_CONCAT                                      ~13     !3, '+files%3Cbr%3E%0A'
        21        ECHO                                                     ~13
  17    22        INIT_FCALL                                               'sort'
        23        SEND_REF                                                 !1
        24        DO_ICALL                                                 
  20    25        ECHO                                                     '%3CTABLE+border%3D1+cellpadding%3D5+cellspacing%3D0+class%3Dwhitelinks%3E%0A'
  21    26        ECHO                                                     '%3CTR%3E%3CTH%3EFilename%3C%2FTH%3E%3Cth%3EFiletype%3C%2Fth%3E%3Cth%3EFilesize%3C%2Fth%3E%3C%2FTR%3E%0A'
  23    27        ASSIGN                                                   !4, 0
        28      > JMP                                                      ->63
  24    29    >   INIT_FCALL                                               'substr'
        30        FETCH_DIM_R                                      $16     !1, !4
        31        CAST                                          6  ~17     $16
        32        SEND_VAL                                                 ~17
        33        SEND_VAL                                                 0
        34        SEND_VAL                                                 1
        35        DO_ICALL                                         $18     
        36        IS_NOT_EQUAL                                     ~19     $18, '.'
        37      > JMPZ                                                     ~19, ->61
  25    38    >   FETCH_DIM_R                                      $20     !1, !4
        39        ROPE_INIT                                     5  ~23     '%3CTR%3E%3CTD%3E%3Ca+href%3D%22'
        40        ROPE_ADD                                      1  ~23     ~23, $20
        41        FETCH_DIM_R                                      $21     !1, !4
        42        ROPE_ADD                                      2  ~23     ~23, '%22%3E'
        43        ROPE_ADD                                      3  ~23     ~23, $21
        44        ROPE_END                                      4  ~22     ~23, '%3C%2Fa%3E%3C%2Ftd%3E'
        45        ECHO                                                     ~22
  26    46        ECHO                                                     '%3Ctd%3E'
  27    47        INIT_FCALL                                               'filetype'
        48        FETCH_DIM_R                                      $26     !1, !4
        49        SEND_VAR                                                 $26
        50        DO_ICALL                                         $27     
        51        ECHO                                                     $27
  28    52        ECHO                                                     '%3C%2Ftd%3E'
  29    53        ECHO                                                     '%3Ctd%3E'
  30    54        INIT_FCALL                                               'filesize'
        55        FETCH_DIM_R                                      $28     !1, !4
        56        SEND_VAR                                                 $28
        57        DO_ICALL                                         $29     
        58        ECHO                                                     $29
  31    59        ECHO                                                     '%3C%2Ftd%3E'
  32    60        ECHO                                                     '%3C%2FTR%3E%0A'
  23    61    >   POST_INC                                         ~30     !4
        62        FREE                                                     ~30
        63    >   IS_SMALLER                                       ~31     !4, !3
        64      > JMPNZ                                                    ~31, ->29
  35    65    >   ECHO                                                     '%3C%2FTABLE%3E%0A'
        66      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0