#36720 [NEW]: chunk_split doesn't cut string property

From: Date: Mon, 13 Mar 2006 14:41:46 +0000
Subject: #36720 [NEW]: chunk_split doesn't cut string property
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-94282@lists.php.net to get a copy of this message
From:             astur103 at hotmail dot com
Operating system: Windows XP Pro SP2
PHP version:      5.1.2
PHP Bug Type:     Unknown/Other Function
Bug description:  chunk_split doesn't cut string property

Description:
------------
Sometimes, above all if memory is clean or the function is not loaded in
memory and has to do it, chunk_split cut a base64 string wrongly.

Later, works fine.

Reproduce code:
---------------
This is the used function:

function compress_gz($string, $level = "1") {
	$final_string = "";
	IF(!empty($string)) {
		$final_string = chunk_split(base64_encode(gzcompress($string,
$level)));
	}
	return $final_string;
	unset($string);
	unset($final_string);
}


Expected result:
----------------
I guess that something like this ...

---- LAST 3 LINES OF STRING ---

0r5uCiYhgApgyg3dCkwmwrauUwVphDguNk2YXJFHqWtjYBAbJjL9iS4X14tgmvRNyD6ef+L3Ve3y
5eLawo1+GJjEDVylt2st73hav2fuh90XV7iJbHVZexbnfz9M2d8Yszv8AKlPYUQ==

---- END ----


Actual result:
--------------
---- LAST 3 LINES OF STRING ---

0r5uCiYhgApgyg3dCkwmwrauUwVphDguNk2YXJFHqWtjYBAbJjL9iS4X14tgmvRNyD6ef+L3Ve3y
5eLawo1+GJjEDVylt2st73hav2fuh90XV7iJbHVZexbnfz9M2d8=
Yszv8AKlPYUQ==

---- END ----


-- 
Edit bug report at http://bugs.php.net/?id=36720&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36720&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36720&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36720&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36720&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=36720&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36720&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36720&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36720&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36720&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36720&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=36720&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=36720&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36720&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36720&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36720&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36720&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36720&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36720&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36720&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36720&r=mysqlcfg


Thread (6 messages)

« previous php.bugs (#94282) next »