|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #48085 [PATCH] pack & unpack missing for 64 bit data
Submitted: 2009-04-27 09:19 UTC Modified: 2015-07-07 17:36 UTC
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:4 (100.0%)
From: vivekanandan8 at yahoo dot com Assigned: cmb (profile)
Status: Closed Package: Strings related
PHP Version: 5.3.0RC1 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: vivekanandan8 at yahoo dot com
New email:
PHP Version: OS:


 [2009-04-27 09:19 UTC] vivekanandan8 at yahoo dot com
In the PHP 5.3,packing and unpacking function is done like Perl,
but like in Perl processing for 64 bit data is missing.Hence  Implemented it and tested it, the source code as follows

The PHP example code also found at

Reproduce code:
$vBinData = pack("Q", 0x1234567812345678);
$vHexData = bin2hex($vBinData);

list(,$v32Value) = unpack('Q', chr(0x80).chr(0x00).chr(0x00).chr(0x00).chr(0x00).chr(0x00).chr(0x00).chr(0x09));
print $v32Value.'<br>'."\n";
echo hexdec(dechex($v32Value)) . "0x" . dechex($v32Value) . "<br>";

Expected result:

Actual result:
This is not implemented  like in Perl 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-08 18:24 UTC]
-Package: Feature/Change Request +Package: Strings related
 [2015-07-07 17:36 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-07-07 17:36 UTC]
This has been implemented in the meantime, see
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 21 10:01:24 2021 UTC