ID: 41045 User updated by: xris01 at free dot fr Reported By: xris01 at free dot fr Status: Bogus Bug Type: Math related Operating System: Debian Sarge PHP Version: 5.2.1 New Comment:
Please, can you precise what does it mean ? The next 5.2.1.x release will contain a fix ? thanks. Previous Comments: ------------------------------------------------------------------------ [2007-04-11 13:58:56] [EMAIL PROTECTED] A bug has been fixed, the behaviour has changed. ------------------------------------------------------------------------ [2007-04-11 01:31:48] xris01 at free dot fr Description: ------------ I understand that floats are expected to overflow when converted to int. What I don't, is why I don't have the same result on the same hardware with 2 versions of PHP : Reproduce code: --------------- $var = -2302452860; echo 'var_dump($var) = '; echo var_dump($var); echo "<br>"; echo '$var = '; echo $var; echo "<br>"; echo 'intval($var) = '; echo intval($var); echo "<br>"; On PHP 5.2.1, it returns : var_dump($var) = float(-2302452860) $var = -2302452860 intval($var) = -2147483648 On PHP 5.1.6, it returns : var_dump($var) = float(-2302452860) $var = -2302452860 intval($var) = 1992514436 Is there anyway to get, in any case, the truncated result ? Any php.ini parameter ? Thanks. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41045&edit=1