From:             tokul at users dot sourceforge dot net
Operating system: Linux
PHP version:      5.0.2
PHP Bug Type:     Variables related
Bug description:  big integers don't overflow

Description:
------------
If big number (2500072158) is converted to integer, php 5.0.2 does not
overflow and uses max integer value (2147483647).

OS details: Linux Debian Sarge

PHP compilation details (vanilla php-5.0.2.tar.bz2):
./configure --disable-debug --with-apxs=/somepath/apache/bin/apxs 
--prefix=/somepath/php 
--with-config-file-path=/somepath/ 
--with-pcre-regex --enable-mbstring --enable-session --disable-all
--with-gettext=shared,/usr

php.ini details:
error_reporting=E_ALL
display_errors=on
register_globals=off
asp_tags=on
short_tags=off

Is this standard future php behaviour or just some error in my config?


Reproduce code:
---------------
echo (int)0xde120495;

Expected result:
----------------
-569244523


Actual result:
--------------
2147483647

-- 
Edit bug report at http://bugs.php.net/?id=30315&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30315&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30315&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30315&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30315&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30315&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30315&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30315&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30315&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30315&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30315&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30315&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30315&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30315&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30315&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30315&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30315&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30315&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30315&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30315&r=mysqlcfg

Reply via email to