6 skipif(!function_exists('http_gzencode'), 'need zlib');
12 error_reporting(E_ALL);
17 for ($i = 0; $i < 1000000; $i++) {
18 $s .= chr(rand(0,255));
21 /* cannot test ext/zlib against this generated data,
22 because it will fail with such widely differing binary data */
24 var_dump($s == http_gzdecode(http_gzencode($s)));
25 var_dump($s == http_inflate(http_deflate($s)));
26 var_dump($s == http_uncompress(http_compress($s)));
28 if (extension_loaded('zlib')) {
30 $s = "A simple test string, which won't blow up ext/zlib.\n";
32 ($s == http_gzdecode(gzencode($s))) or print "GZIP Failed\n";
33 ($s == http_inflate(gzdeflate($s))) or print "DEFLATE Failed\n";
34 ($s == http_uncompress(gzcompress($s))) or print "COMPRESS Failed\n";
36 /* no gzdecode in ext/zlib
37 ($s == gzdecode(http_gzencode($s))) or print "GZIP Failed\n"; */
38 ($s == gzinflate(http_deflate($s))) or print "DEFLATE Failed\n";
39 ($s == gzuncompress(http_compress($s))) or print "COMPRESS Failed\n";
41 (gzencode($s) == http_gzencode($s)) or print "GZIP Failed\n";
42 (gzdeflate($s) == http_deflate($s)) or print "DEFLATE Failed\n";
43 (gzcompress($s) == http_compress($s)) or print "COMPRESS Failed\n";