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);

preferences:
32.16 ms | 402 KiB | 5 Q