php-src/ext/zlib/tests/003.phpt
Stefan Roehrich edcb5813db (PHP gzencode) Reimplementation of gzencode(). Now works as documented
(gzencode(string data [, int level [, int encoding_mode]])),
               should fix #15930.
@- The second parameter of gzencode() now is the compression level like
@  in the documentation. The encoding mode is a third (optional) parameter.
# Rework of gzencode(), output should be closer to real gzip output.
# I think in the old version there could be some problems with
# this function and output compression, should be fixed, too.
2002-03-12 13:23:58 +00:00

17 lines
523 B
PHP

--TEST--
gzencode()/base64_encode()
--SKIPIF--
<?php if (!extension_loaded("zlib")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php
$original = str_repeat("hallo php",4096);
$packed=gzencode($original);
echo strlen($packed)." ".strlen($original)."\n";
if (strcmp(base64_encode($packed),"H4sIAAAAAAAAA+3GoQ0AQAgEsFV+NdwJEthf/R6kVU11z9tsRERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERETu5gPlQAe9AJAAAA==")==0) echo "Strings are equal";
?>
--EXPECT--
118 36864
Strings are equal