title: How to get an HTTP response as a stream in PHP?
body: <p>My application's backend in PHP sends HTTP requests to other servers and receives large responses from them.</p>
  
  <p>At the moment I'm using <code>curl_setopt($curlResource, CURLOPT_FILE, $fileResource);</code> to avoid storing the response in memory so I don't have to increase memory limits for the script.</p>
  
  <p>What I want to achieve is for my script to receive the HTTP response from other server and to process it in real-time, discarding pieces of data already processed.</p>
  
  <p>Is it even possible without something fancy like a socket connection to ports 80 or 443 to receive data without the help of CURL?</p>