2001-07-13 23:48:37 +08:00
|
|
|
--TEST--
|
|
|
|
gzcompress()/gzuncompress()
|
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("zlib")) print "skip"; ?>
|
|
|
|
--FILE--
|
2003-09-06 23:31:35 +08:00
|
|
|
<?php /* $Id$ */
|
2001-07-13 23:48:37 +08:00
|
|
|
$original = str_repeat("hallo php",4096);
|
|
|
|
$packed=gzcompress($original);
|
|
|
|
echo strlen($packed)." ".strlen($original)."\n";
|
|
|
|
$unpacked=gzuncompress($packed);
|
2003-09-06 23:31:35 +08:00
|
|
|
if (strcmp($original,$unpacked)==0) echo "Strings are equal\n";
|
|
|
|
|
|
|
|
/* with explicit compression level, length */
|
|
|
|
$original = str_repeat("hallo php",4096);
|
|
|
|
$packed=gzcompress($original, 9);
|
|
|
|
echo strlen($packed)." ".strlen($original)."\n";
|
|
|
|
$unpacked=gzuncompress($packed, 40000);
|
|
|
|
if (strcmp($original,$unpacked)==0) echo "Strings are equal\n";
|
2001-07-13 23:48:37 +08:00
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
106 36864
|
|
|
|
Strings are equal
|
2003-09-06 23:31:35 +08:00
|
|
|
106 36864
|
|
|
|
Strings are equal
|