note 83349 added to function.unpack
| From: | Nhon at osu1 dot php dot net | Date: | Wed, 21 May 2008 20:42:21 +0000 |
| Subject: | note 83349 added to function.unpack | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139594@lists.php.net to get a copy of this message | ||
As stated above, "if you unpack a large unsigned long and it is of the same size as PHP
internally stored values the result will be a negative number even though unsigned unpacking was
specified."
To restore the original unsigned value, you could do this :
if ($unpackedVal <0)
{
$unpackedVal += 4294967296;
}
Hope this helps !
Cheers
----
Server IP: 213.246.42.8
Probable Submitter: 62.147.129.134
----
Manual Page -- http://www.php.net/manual/en/function.unpack.php
Edit -- https://master.php.net/note/edit/83349
Del: integrated -- https://master.php.net/note/delete/83349/integrated
Del: useless -- https://master.php.net/note/delete/83349/useless
Del: bad code -- https://master.php.net/note/delete/83349/bad+code
Del: spam -- https://master.php.net/note/delete/83349/spam
Del: non-english -- https://master.php.net/note/delete/83349/non-english
Del: in docs -- https://master.php.net/note/delete/83349/in+docs
Del: other reasons-- https://master.php.net/note/delete/83349
Reject -- https://master.php.net/note/reject/83349
Search -- https://master.php.net/manage/user-notes.php