From:             [EMAIL PROTECTED]
Operating system: i686-pc-linux-gnu
PHP version:      4.0CVS-2001-07-12
PHP Bug Type:     Zlib Related
Bug description:  zlib uncompress buffer error/ inflate failed


the follow code produces a deflated string
which php can not inflate.

php results:
"Warning: gzinflate: buffer error in /web/htdocs/thisfile.php"

mt_srand ((double) microtime() * 1000000);

for ($original="",$i=0;$i<5000;$i++){
        //$original.=chr(mt_rand()); // 
        $original.="lala "; // problem

$packed=gzdeflate($original); // gzcompress
$unpacked=gzinflate($packed); // gzuncompress

echo "Length original:".strlen($original)."<br>";
echo "Length packed:".strlen($packed)."<br>";
echo "Length unpacked:".strlen($unpacked)."<br>";

if (strcmp($original,$unpacked)==0) echo "Strings are equal";
else echo "<b>Strings <u>not</u> equal</b>";


Edit bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to