mirror of
https://github.com/php/php-src.git
synced 2024-11-26 03:16:33 +08:00
cede952f6a
Fixed prototype and added test for #14939. # We have extra \0 if the input comes directly from gzdeflate() # so give one extra byte as length to workaround behaviour of zlib. # I want to avoid copying the input, but if there are problems, # please tell (see my message <20020310175611.GA4472@stefan.roehri.ch> to # php-dev).
26 lines
621 B
PHP
26 lines
621 B
PHP
--TEST--
|
|
gzdeflate()/gzinflate()
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("zlib")) print "skip"; ?>
|
|
--POST--
|
|
--GET--
|
|
--FILE--
|
|
<?php
|
|
$original = str_repeat("hallo php",4096);
|
|
$packed=gzdeflate($original);
|
|
echo strlen($packed)." ".strlen($original)."\n";
|
|
$unpacked=gzinflate($packed);
|
|
if (strcmp($original,$unpacked)==0) echo "Strings are equal";
|
|
|
|
echo "\n";
|
|
$original = 'aaaaaaaaaaaaaaa';
|
|
$packed=gzdeflate($original);
|
|
echo strlen($packed)." ".strlen($original)."\n";
|
|
$unpacked=gzinflate($packed);
|
|
if (strcmp($original,$unpacked)==0) echo "Strings are equal";
|
|
?>
|
|
--EXPECT--
|
|
100 36864
|
|
Strings are equal
|
|
5 15
|
|
Strings are equal
|