title: How to access fields inside a stream resource in PHP?
body: <p>I cannot access individual fields inside a stream resource (called <code>$handle</code>).</p>
  <p>The resource is a result of me checking if an image file exists on the server:</p>
  <pre><code>$handle = @fopen($cdnPath . &quot;/adblock&quot; . $site_id . '.jpg', 'r');
  </code></pre>
  <p>If it does, I get this when id execute dump($handle);</p>
  <pre><code>stream resource @97 ▼
    crypto: array:4 [▶]
    timed_out: false
    blocked: true
    eof: false
    wrapper_data: array:17 [▶]
    wrapper_type: &quot;http&quot;
    stream_type: &quot;tcp_socket/ssl&quot;
    mode: &quot;r&quot;
    unread_bytes: 552
    seekable: false
    uri: &quot;https://cdn.pixfuture.com/adblock_logo/adblock14.jpg&quot;
    options: []
  }
  </code></pre>
  <p>How can I access the <code>uri</code> field, and store it into a variable?
  I tried <code>$handle-&gt;uri</code>, and <code>$handle['uri']</code>, none of which worked.</p>