3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://localhost/img'; $dir = 'C:\Program Files\Apache Group\Apache2\htdocs\img'; $max = 5; $images = preg_grep('/\.(?:jpe?g|gif|png)\z/i', @scandir($dir)); array_walk($images, function (&$v) { $v = $url . $v; }); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <h1><?=$dir?>内の画像一覧</h1> <?php if (!$images): ?> <p>表示する画像はありません</p> <?php else: ?> <table> <tr> <?php foreach ($images as $i => $img): ?> <?php if ($i !== 0 && $i % $max === 0): ?> </tr> <tr> <?php endif; ?> <td><img src="<?=$img?>"></td> <?php endforeach; ?> </tr> </table> <?php endif; ?> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 40
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 40
Branch analysis from position: 28
2 jumps found. (Code = 46) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 36
Branch analysis from position: 34
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/OQTIm
function name:  (null)
number of ops:  44
compiled vars:  !0 = $url, !1 = $dir, !2 = $max, !3 = $images, !4 = $img, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Flocalhost%2Fimg'
    4     1        ASSIGN                                                   !1, 'C%3A%5CProgram+Files%5CApache+Group%5CApache2%5Chtdocs%5Cimg'
    5     2        ASSIGN                                                   !2, 5
    7     3        INIT_FCALL                                               'preg_grep'
          4        SEND_VAL                                                 '%2F%5C.%28%3F%3Ajpe%3Fg%7Cgif%7Cpng%29%5Cz%2Fi'
          5        BEGIN_SILENCE                                    ~9      
          6        INIT_FCALL                                               'scandir'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $10     
          9        END_SILENCE                                              ~9
         10        SEND_VAR                                                 $10
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !3, $11
    8    13        INIT_FCALL                                               'array_walk'
         14        SEND_REF                                                 !3
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOQTIm%3A8%240'
   10    16        SEND_VAL                                                 ~13
         17        DO_ICALL                                                 
   13    18        ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3Cmeta+charset%3D%22UTF-8%22%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Ch1%3E'
   19    19        ECHO                                                     !1
         20        ECHO                                                     '%E5%86%85%E3%81%AE%E7%94%BB%E5%83%8F%E4%B8%80%E8%A6%A7%3C%2Fh1%3E%0A'
   20    21        BOOL_NOT                                         ~15     !3
         22      > JMPZ                                                     ~15, ->25
   21    23    >   ECHO                                                     '%3Cp%3E%E8%A1%A8%E7%A4%BA%E3%81%99%E3%82%8B%E7%94%BB%E5%83%8F%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%3C%2Fp%3E%0A'
         24      > JMP                                                      ->42
   23    25    >   ECHO                                                     '%3Ctable%3E%0A%3Ctr%3E%0A'
   25    26      > FE_RESET_R                                       $16     !3, ->40
         27    > > FE_FETCH_R                                       ~17     $16, !4, ->40
         28    >   ASSIGN                                                   !5, ~17
   26    29        IS_NOT_IDENTICAL                                 ~19     !5, 0
         30      > JMPZ_EX                                          ~19     ~19, ->34
         31    >   MOD                                              ~20     !5, !2
         32        IS_IDENTICAL                                     ~21     ~20, 0
         33        BOOL                                             ~19     ~21
         34    > > JMPZ                                                     ~19, ->36
   27    35    >   ECHO                                                     '%3C%2Ftr%3E%0A%3Ctr%3E%0A'
   30    36    >   ECHO                                                     '%3Ctd%3E%3Cimg+src%3D%22'
         37        ECHO                                                     !4
         38        ECHO                                                     '%22%3E%3C%2Ftd%3E%0A'
   25    39      > JMP                                                      ->27
         40    >   FE_FREE                                                  $16
   32    41        ECHO                                                     '%3C%2Ftr%3E%0A%3C%2Ftable%3E%0A'
   35    42    >   ECHO                                                     '%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   36    43      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FOQTIm%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OQTIm
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $v, !1 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        CONCAT                                           ~2      !1, !0
          2        ASSIGN                                                   !0, ~2
   10     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOQTIm%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.95 ms | 1400 KiB | 19 Q