compress.zlib://host/path isn't actually valid.
What is valid however (as of PHP5) is:
$fp = fopen('http://host/path/file.gz', 'r');
/* Maybe a small fread() here to consume gzip headers, I don't recall if they're sent with deflated content */
stream_filter_append($fp, 'zlib.inflate');
Note: For PHP 5.0 you need PECL package zlib_filter, it'll be rolled into the core in PHP 5.1 .
The patch supplied above needs further review as I see a big potential for zlib stream errors with the read buffer blocks that come in with the headers.

Wez needs to chime in on this...
I stated that it wouldn't work for http (with or without the patch) because I thought we had disabled shrinking the chunk_size to 1 while reading into the HTTP headers (for performance reasons). Looking back at the code I see that the temporary shift into small chuck sizes *IS* enabled when the STREAM_WILL_CAST flag is set (which it is for the zlib fopen wrapper).
Maybe it was the conditional set based on the option flag that was the compromise... in which case I'd say: Go ahead and use fopen('compress.zlib://http://blah...',... but the patch provided for gzopen() seems completely unnecessary.

You cannot drop STREAM_MUST_SEEK because the handler uses
seek. In case of http or ftp or what ever forward streams a temporary file is created automatically so it still works as expected.

[2007-02-19 13:20 UTC] infos at firmalarsirketler dot com

thank you for this nice site

[2010-04-05 17:52 UTC] zelnaga at gmail dot com

This doesn't seem to work.
fopen('compress.zlib://php://temp', 'r+');
When I try it I get the following:
Warning: fopen(compress.zlib://php://temp): failed to open stream: operation failed in C:\htdocs\www\test.php on line 1
Per this, though, it seems like it should work?