#40178 [Opn->Bgs]: Differents systems return differents values

From: Date: Sat, 20 Jan 2007 02:15:55 +0000
Subject: #40178 [Opn->Bgs]: Differents systems return differents values
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107810@lists.php.net to get a copy of this message
ID: 40178 Updated by: pajoye@php.net Reported By: bpita at netcombbs dot com -Status: Open +Status: Bogus Bug Type: *Network Functions Operating System: Win32, Linux32 and Linux64 PHP Version: 5.2.0 New Comment: (bogus means "Not a bug" here) This is the internal representation of signed integer using unsigned integer. 32bits use one bit for the sign, that explains the negative _displayed_ values, but the internal values are the same. Big numbers should be processed using bcmath or pecl/big_int Previous Comments: ------------------------------------------------------------------------ [2007-01-20 00:50:32] bpita at netcombbs dot com Description: ------------ Hi, I use this code in differents operating systems and plataforms (intel and amd) and return differents results. It's a bug ? Any comments ? Thanks, Bernardo. Reproduce code: --------------- echo ip2long('255.255.255.128'); echo ip2long('255.255.255.192'); echo ip2long('255.255.255.248'); Expected result: ---------------- 32 bits systems returns: -128 -64 -8 --------------------- 64 bits systems returns: 4294967168 4294967232 4294967288 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40178&edit=1

« previous php.bugs (#107810) next »