php compression filters and gzcompress not returning the same result
<p>I get different output when I run my code through zlib <a href="http://php.net/manual/en/filters.compression.php" rel="nofollow noreferrer">compression filters</a> </p>

<p>My code:</p>

<pre><code>&lt;?php
$data = 'zzzzzzzzzzzzzzzzzzzzzzzzzzz';

$params = array('level' =&gt; 6, 'window' =&gt; 15, 'memory' =&gt; 9);
//$params = 6;
$fp = fopen('php://memory', 'wb+');
stream_filter_append($fp, 'zlib.deflate', STREAM_FILTER_WRITE, $params);
fputs($fp, $data);
rewind($fp);

echo bin2hex(stream_get_contents($fp)) . "\n";
echo bin2hex(gzcompress($data)) . "\n";
</code></pre>

<p>The output:</p>

<pre><code>789c
789cabaaa2260000bce3252d
</code></pre>

<p>It's my understanding that 789c is the <a href="https://stackoverflow.com/a/30794147/569976">header for normal compression</a>. So I have no idea what's up. Do compression streams just not work in PHP?</p>

<p>Any ideas would be appreciated - thanks!</p>