|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-03-19 20:27 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2013-03-19 20:27 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 09:00:01 2025 UTC |
Description: ------------ On some circumstances it's possible to get a wrong integer value on casting from float. I can reproduce this bug with the following installations: php -v PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:34:31) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans ./sapi/cli/php -v PHP 5.6.0-dev (cli) (built: Mar 17 2013 22:02:54) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.6.0-dev, Copyright (c) 1998-2013 Zend Technologies Test script: --------------- // this works $v = (float) 6; var_dump($v, (int)$v); // this is wrong $v = log(64, 2); var_dump($v, (int)$v); Expected result: ---------------- float(6) int(6) float(6) int(6) Actual result: -------------- float(6) int(6) float(6) int(5)