Bug #54903 [NEW]: unpack("H*hex", $data) is adding an extra character to the end of the string.

From: Date: Sun, 22 May 2011 08:50:08 +0000
Subject: Bug #54903 [NEW]: unpack("H*hex", $data) is adding an extra character to the end of the string.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-160895@lists.php.net to get a copy of this message
From:             
Operating system: Windows 7
PHP version:      5.3.6
Package:          Unknown/Other Function
Bug Type:         Bug
Bug description:unpack("H*hex", $data) is adding an extra character to the end of the
string.

Description:
------------
Same bug as http://bugs.php.net/36148

unpack("H*hex", $data) is adding an unexpected extra character to the end
of the string.


Test script:
---------------
$Value = pack("H*", "263");
$Result	= unpack("H*", $Value);

Expected result:
----------------
$Result = "263";

Actual result:
--------------
$Result = "2630";

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54903&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54903&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54903&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54903&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54903&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54903&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54903&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54903&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54903&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54903&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54903&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54903&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54903&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54903&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54903&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54903&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54903&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54903&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54903&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54903&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54903&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54903&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#160895) next »