3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mfd = array(); $it = new DirectoryIterator("glob:///proc/self/fd/*"); foreach($it as $f) { $tmpArr = array(); $tmpArr['fd'] = $fd = fopen("php://fd/" . $f->getFilename(), 'r+'); $details = stream_get_meta_data($fd); $tmpArr['type'] = $details['stream_type']; $tmpArr['state'] = $details['blocked']; $tmpArr['uri'] = $details['uri']; $tmpArr['mode'] = $details['mode']; $tmpArr['filepath'] = readlink('/proc/self/fd/' . $f->getFilename()); $mfd[ $f->getFilename() ] = $tmpArr; } print_r($mfd);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 47
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 47
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/l3anu
function name:  (null)
number of ops:  52
compiled vars:  !0 = $mfd, !1 = $it, !2 = $f, !3 = $tmpArr, !4 = $fd, !5 = $details
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        NEW                                              $7      'DirectoryIterator'
          2        SEND_VAL_EX                                              'glob%3A%2F%2F%2Fproc%2Fself%2Ffd%2F%2A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $7
    4     5      > FE_RESET_R                                       $10     !1, ->47
          6    > > FE_FETCH_R                                               $10, !2, ->47
    5     7    >   ASSIGN                                                   !3, <array>
    6     8        INIT_FCALL                                               'fopen'
          9        INIT_METHOD_CALL                                         !2, 'getFilename'
         10        DO_FCALL                                      0  $13     
         11        CONCAT                                           ~14     'php%3A%2F%2Ffd%2F', $13
         12        SEND_VAL                                                 ~14
         13        SEND_VAL                                                 'r%2B'
         14        DO_ICALL                                         $15     
         15        ASSIGN                                           ~16     !4, $15
         16        ASSIGN_DIM                                               !3, 'fd'
         17        OP_DATA                                                  ~16
    7    18        INIT_FCALL                                               'stream_get_meta_data'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $17     
         21        ASSIGN                                                   !5, $17
    8    22        FETCH_DIM_R                                      ~20     !5, 'stream_type'
         23        ASSIGN_DIM                                               !3, 'type'
         24        OP_DATA                                                  ~20
    9    25        FETCH_DIM_R                                      ~22     !5, 'blocked'
         26        ASSIGN_DIM                                               !3, 'state'
         27        OP_DATA                                                  ~22
   10    28        FETCH_DIM_R                                      ~24     !5, 'uri'
         29        ASSIGN_DIM                                               !3, 'uri'
         30        OP_DATA                                                  ~24
   11    31        FETCH_DIM_R                                      ~26     !5, 'mode'
         32        ASSIGN_DIM                                               !3, 'mode'
         33        OP_DATA                                                  ~26
   12    34        INIT_FCALL                                               'readlink'
         35        INIT_METHOD_CALL                                         !2, 'getFilename'
         36        DO_FCALL                                      0  $28     
         37        CONCAT                                           ~29     '%2Fproc%2Fself%2Ffd%2F', $28
         38        SEND_VAL                                                 ~29
         39        DO_ICALL                                         $30     
         40        ASSIGN_DIM                                               !3, 'filepath'
         41        OP_DATA                                                  $30
   13    42        INIT_METHOD_CALL                                         !2, 'getFilename'
         43        DO_FCALL                                      0  $31     
         44        ASSIGN_DIM                                               !0, $31
         45        OP_DATA                                                  !3
    4    46      > JMP                                                      ->6
         47    >   FE_FREE                                                  $10
   15    48        INIT_FCALL                                               'print_r'
         49        SEND_VAR                                                 !0
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
252.85 ms | 1400 KiB | 22 Q