3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dir = '/proc/'; if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if ("dir" == filetype($dir . $file) && file_exists($dir . $file . '/cmdline')) { readfile($dir . $file . '/cmdline'); } echo "filename: $file : filetype: " . filetype($dir . $file) . "\n"; } closedir($dh); } //readfile('/proc/20722/cmdline');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 44
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 7
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 7
Branch analysis from position: 41
Branch analysis from position: 7
Branch analysis from position: 25
Branch analysis from position: 19
Branch analysis from position: 44
filename:       /in/rL0Aa
function name:  (null)
number of ops:  45
compiled vars:  !0 = $dir, !1 = $dh, !2 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2Fproc%2F'
    3     1        INIT_FCALL                                               'opendir'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                           ~5      !1, $4
          5      > JMPZ                                                     ~5, ->44
    4     6    > > JMP                                                      ->35
    5     7    >   INIT_FCALL                                               'filetype'
          8        CONCAT                                           ~6      !0, !2
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        IS_EQUAL                                         ~8      $7, 'dir'
         12      > JMPZ_EX                                          ~8      ~8, ->19
         13    >   INIT_FCALL                                               'file_exists'
         14        CONCAT                                           ~9      !0, !2
         15        CONCAT                                           ~10     ~9, '%2Fcmdline'
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                         $11     
         18        BOOL                                             ~8      $11
         19    > > JMPZ                                                     ~8, ->25
    6    20    >   INIT_FCALL                                               'readfile'
         21        CONCAT                                           ~12     !0, !2
         22        CONCAT                                           ~13     ~12, '%2Fcmdline'
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                                 
    8    25    >   ROPE_INIT                                     3  ~16     'filename%3A+'
         26        ROPE_ADD                                      1  ~16     ~16, !2
         27        ROPE_END                                      2  ~15     ~16, '+%3A+filetype%3A+'
         28        INIT_FCALL                                               'filetype'
         29        CONCAT                                           ~18     !0, !2
         30        SEND_VAL                                                 ~18
         31        DO_ICALL                                         $19     
         32        CONCAT                                           ~20     ~15, $19
         33        CONCAT                                           ~21     ~20, '%0A'
         34        ECHO                                                     ~21
    4    35    >   INIT_FCALL                                               'readdir'
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                         $22     
         38        ASSIGN                                           ~23     !2, $22
         39        TYPE_CHECK                                  1018          ~23
         40      > JMPNZ                                                    ~24, ->7
   10    41    >   INIT_FCALL                                               'closedir'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                                 
   12    44    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.54 ms | 1400 KiB | 25 Q