#38770 [Opn->Bgs]: pack/unpack is broken on 64bit

From: Date: Sun, 10 Sep 2006 16:03:10 +0000
Subject: #38770 [Opn->Bgs]: pack/unpack is broken on 64bit
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-101963@lists.php.net to get a copy of this message
ID: 38770 Updated by: tony2001@php.net Reported By: fwmatt at dsl dot pipex dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux x86_64 PHP Version: 5.1.6 New Comment: http://php.net/pack: N - unsigned long (always 32 bit, big endian byte order) Previous Comments: ------------------------------------------------------------------------ [2006-09-10 15:55:20] fwmatt at dsl dot pipex dot com Description: ------------ On my 32bit x86 system the attached code produces the expected results, however on my x86 64bit system it produces the (actual) attached. Reproduce code: --------------- print_r( unpack( "N", pack( 'N', -30000 ) )); Expected result: ---------------- Array ( [1] => -30000 ) Actual result: -------------- Array ( [1] => 4294937296 ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38770&edit=1

« previous php.bugs (#101963) next »