ID: 40543
Updated by: [EMAIL PROTECTED]
Reported By: dedmajor at gmail dot com
-Status: Bogus
+Status: Open
Bug Type: Unknown/Other Function
Operating System: linux x86_64
PHP Version: 5.2.1
New Comment:
This isn't bogus, this is a real bug that causes pain.
N is there for people writing code that talks to network services that
need to convert numbers from network byte order to the native format.
Also note that we get a bonus crash bug on 64-bit platforms too:
$fail = '\x00\x00\x00\x8c';
$result = unpack('Nsize', $fail);
$size = $result['size'] & 0xffffffff; // BANG!
Previous Comments:
------------------------------------------------------------------------
[2007-02-24 15:12:29] [EMAIL PROTECTED]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
You should be using either L or V, not N.
------------------------------------------------------------------------
[2007-02-19 13:34:38] dedmajor at gmail dot com
Description:
------------
#38770 not fixed(?) in 5.2.1-dev
on x86_64 AMD Opteron(tm) Processor 265 unpack don't work, on i686
Intel(R) Celeron(R) CPU 2.50GHz works fine for example.
Reproduce code:
---------------
php -r 'print_r(unpack("N", pack("N", 41445)));
Expected result:
----------------
Array
(
[1] => 41445
)
Actual result:
--------------
Array
(
[1] => -2147442203
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40543&edit=1