6 skipif(!function_exists('http_deflate'), 'need zlib');
13 error_reporting(E_ALL);
17 for ($i = 0; $i < 5000; ++$i) {
18 $s .= chr(rand(0,255));
21 var_dump($s == http_inflate(http_deflate($s, HTTP_DEFLATE_TYPE_ZLIB)));
22 var_dump($s == http_inflate(http_deflate($s, HTTP_DEFLATE_TYPE_GZIP)));
23 var_dump($s == http_inflate(http_deflate($s, HTTP_DEFLATE_TYPE_RAW)));
25 if (extension_loaded('zlib')) {
27 $s = "A simple test string, which won't blow up ext/zlib.\n";
29 ($s == http_inflate(gzencode($s))) or print "GZIP Failed\n";
30 ($s == http_inflate(gzdeflate($s))) or print "DEFLATE Failed\n";
31 ($s == http_inflate(gzcompress($s))) or print "COMPRESS Failed\n";
33 ($s == gzinflate(http_deflate($s, HTTP_DEFLATE_TYPE_RAW))) or print "INFLATE Failed\n";
34 ($s == gzuncompress(http_deflate($s, HTTP_DEFLATE_TYPE_ZLIB))) or print "UNCOMPRESS Failed\n";