PHP 4.0 Bug #9503: bzcompress output is null padded to size of original string

From: Date: Wed, 28 Feb 2001 21:58:45 +0000
Subject: PHP 4.0 Bug #9503: bzcompress output is null padded to size of original string
Groups: php.dev 
Request: Send a blank email to php-dev+get-47688@lists.php.net to get a copy of this message
From: zeekamotay@hotmail.com Operating system: Linux 2.2 [RH6.2] PHP version: 4.0.4pl1 PHP Bug Type: Bzip2 Related Bug description: bzcompress output is null padded to size of original string I compiled PHP 4.0.4pl1 with --bz2, using bzip 1.0.1. Running bzcompress() on a string always returns a string of the same size. The data in the returned string appears to be correctlty compressed though, as it uncompresses correctly when passed back to bzdecompress(). It appears that the first part of the returned string contains the correctly compressed result, and that the returned string is then padded with nulls out to the size of the original string. The gzcompress() function does not behave this way. <? $str = "[...some really huge string...]"; echo strlen($str) . " " . strlen(gzcompress($str,9)) . " " . strlen(bzcompress($str,9)); ?> This generates the output: 14092 2348 14092 -- Edit Bug report at: http://bugs.php.net/?id=9503&edit=1

« previous php.dev (#47688) next »