Re: different behaviour converting float to integer

From: Date: Mon, 04 Oct 2004 10:50:48 +0000
Subject: Re: different behaviour converting float to integer
References: 1  Groups: php.general php.internals 
Request: Send a blank email to php-general+get-198581@lists.php.net to get a copy of this message
You might want to ask this on the internals list (cc'd) Tomas Kuliavas wrote:
When php 5.0.2 converts float to integer, it uses biggest possible integer value. Other php versions overflow and use negalive integers. How to reproduce it: echo (int)0xde120495; Expected result (php 5.0.1, 4.3.9 and 4.1.2): ---------------- -569244523 Actual result (only php 5.0.2): -------------- 2147483647 Is this a standard behaviour of all future php versions or some error in php? 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 Please CC to my email.


« previous php.general (#198581) next »