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