I don't have any deep knowledge in compression algorithms and formats, so I have no idea if this works the same on all platforms. But by several experiments on my Linux box I found how to get gzdecoded data without temporary files. Here it is:
<?php
function gzdecode($data)
{
return gzinflate(substr($data,10,-8));
}
?>
That's it. Simply strip header and footer bytes and you get raw deflated data for inflation.