#48867 [NEW]: Casting 0xffffffffffffffff to int does not returns -1
| From: | magicaltux@php.net | Date: | Thu, 09 Jul 2009 11:40:56 +0000 |
| Subject: | #48867 [NEW]: Casting 0xffffffffffffffff to int does not returns -1 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-139520@lists.php.net to get a copy of this message | ||
From: magicaltux@php.net
Operating system: Linux x86_64
PHP version: 5.2.10
PHP Bug Type: Scripting Engine problem
Bug description: Casting 0xffffffffffffffff to int does not returns -1
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 bug report at http://bugs.php.net/?id=48867&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48867&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48867&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48867&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48867&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48867&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48867&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48867&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48867&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48867&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48867&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48867&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48867&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48867&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48867&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48867&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48867&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48867&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48867&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48867&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48867&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48867&r=mysqlcfg