#48867 [Com]: Casting 0xffffffffffffffff to int does not returns -1
| From: | c dot robin at smartphp dot org | Date: | Thu, 09 Jul 2009 11:45:56 +0000 |
| Subject: | #48867 [Com]: Casting 0xffffffffffffffff to int does not returns -1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-139522@lists.php.net to get a copy of this message | ||
ID: 48867
Comment by: c dot robin at smartphp dot org
Reported By: magicaltux@php.net
Status: Open
Bug Type: Scripting Engine problem
Operating System: Linux x86_64
PHP Version: 5.2.10
New Comment:
Reproduced on ArchLinux ( both compiled package and custom compiled PHP
with no patches ).
Uname:
Linux devrobin 2.6.30-ARCH #1 SMP PREEMPT Sat Jul 4 02:24:43 CEST 2009
x86_64 Intel(R) Core(TM)2 Duo CPU E7200 @ 2.53GHz GenuineIntel GNU/Linux
Previous Comments:
------------------------------------------------------------------------
[2009-07-09 11:44:21] magicaltux@php.net
uname -a of test machines:
Linux Memol.ooKoo.org 2.6.28-gentoo-r3-tux #1 SMP Thu Mar 12 22:09:11
CET 2009 x86_64 Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz GenuineIntel
GNU/Linux
Linux localhost 2.6.30-gentoo-r1 #1 SMP Tue Jun 30 14:06:51 Local time
zone must be set--see zic x86_64 Intel(R) Core(TM)2 Quad CPU Q9550 @
2.83GHz GenuineIntel GNU/Linux
------------------------------------------------------------------------
[2009-07-09 11:40:55] magicaltux@php.net
Description:
------------
Casting hexadecimal representation of -1 to int is supposed to return
-1 in php.
It seems to not reproduce on sunOS.
<dsp_> sapi/cli/php -r 'var_dump((int)0xffffffffffffffff);'
<dsp_> int(-1)
<dsp_> SunOS t2000-010131 5.11 snv_101 sun4v sparc SUNW,Sun-Fire-T200
Solaris
It was reproduced on the following distro of Linux: Gentoo, Arch
It was also reproduced on a self-compiled version of PHP 5.2.10
Reproduce code:
---------------
magicaltux@Memol ~ $ php -r 'var_dump((int)0xffffffffffffffff);'
Expected result:
----------------
int(-1)
Actual result:
--------------
int(0)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48867&edit=1