xref: /PHP-5.3/ext/zlib/tests/002.phpt (revision d94136fc)
1--TEST--
2gzcompress()/gzuncompress()
3--SKIPIF--
4<?php if (!extension_loaded("zlib")) print "skip"; ?>
5--FILE--
6<?php /* $Id$ */
7$original = str_repeat("hallo php",4096);
8$packed=gzcompress($original);
9echo strlen($packed)." ".strlen($original)."\n";
10$unpacked=gzuncompress($packed);
11if (strcmp($original,$unpacked)==0) echo "Strings are equal\n";
12
13/* with explicit compression level, length */
14$original = str_repeat("hallo php",4096);
15$packed=gzcompress($original, 9);
16echo strlen($packed)." ".strlen($original)."\n";
17$unpacked=gzuncompress($packed, 40000);
18if (strcmp($original,$unpacked)==0) echo "Strings are equal\n";
19?>
20--EXPECT--
21106 36864
22Strings are equal
23106 36864
24Strings are equal
25