#38908 [NEW]: big NEGATIVE integers won't overflow on Linux
| From: | golikov at hotmail dot com | Date: | Thu, 21 Sep 2006 04:14:46 +0000 |
| Subject: | #38908 [NEW]: big NEGATIVE integers won't overflow on Linux | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-102494@lists.php.net to get a copy of this message | ||
From: golikov at hotmail dot com
Operating system: Linux (2.6.9-34.0.2.ELsmp)
PHP version: 5.1.6
PHP Bug Type: Variables related
Bug description: big NEGATIVE integers won't overflow on Linux
Description:
------------
If big negative number (-3032250090012579) is converted to integer, php
5.1.6 does not overflow on LINUX and uses max negative integer value
(-2147483648) instead. Though on Windows it works as ok. Related bug
#30315.
Reproduce code:
---------------
$a2 = 2224955379988029;
echo "$a2 => (int)" . (int)$a2 . "\n";
$a3 = -2224955379988029;
echo "$a3 => (int)" . (int)$a3 . "\n";
Expected result:
----------------
2.224955379988E+015 => (int)-888097219
-2.224955379988E+015 => (int)888097219
Actual result:
--------------
2.22495537999E+15 => (int)-888097219
-2.22495537999E+15 => (int)-2147483648
--
Edit bug report at http://bugs.php.net/?id=38908&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38908&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38908&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38908&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38908&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38908&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38908&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38908&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38908&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38908&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38908&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38908&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38908&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38908&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38908&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38908&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38908&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38908&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38908&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38908&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38908&r=mysqlcfg