|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-10-03 21:35 UTC] tokul at users dot sourceforge dot net
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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 00:00:01 2025 UTC |
Unable to reproduce it in apache 1.3.33 and php 5.0.4cvs -rw-r--r-- 1 tomas tomas 5726524 Feb 11 17:40 php5-STABLE-latest.tar.gz md5sum. 94fc7c5bbf2c41c9951c973a5debc90a php5-STABLE-latest.tar.gz PHP API 20031224 PHP Extension 20041030 Zend Extension 220040412 php configure: ./configure --prefix=/home/tomas/testbeds/test2/php \ --with-config-file-path=/home/tomas/testbeds/config/ \ --with-apxs=/home/tomas/testbeds/test2/apache/bin/apxs \ --disable-all --enable-session --with-pcre-regex \ --enable-gettext=shared,/usr --enable-mbstring=all,shared test script: header('Content-Type: text/plain'); echo (int)0x950412de; echo "\n"; echo (int)0xde120495; code works same way in 4.3.10 (debian sarge package) and php 5.0.4cvs. bigger than 0xffffffff hex numbers (from php at botimer dot net test script) cause php notice warnings, but they are not related to this bug report.