#48496 [Opn->Bgs]: String to numerical conversion
| From: | rquadling@php.net | Date: | Mon, 08 Jun 2009 14:55:27 +0000 |
| Subject: | #48496 [Opn->Bgs]: String to numerical conversion | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-2354@lists.php.net to get a copy of this message | ||
ID: 48496
Updated by: rquadling@php.net
Reported By: headden at karelia dot ru
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2009-06-08 14:55:11] rquadling@php.net
As 1234567890123 is larger than a 32bit integer, it is converted to a
float.
Once in a float it is quite happily allowed to be incremented as you
are
using.
------------------------------------------------------------------------
[2009-06-08 14:31:10] headden at karelia dot ru
Description:
------------
http://www.php.net/manual/en/language.types.string.php
"The string will be evaluated as a float if it contains any of the
characters '.', 'e', or 'E'. Otherwise, it will be evaluated as an
integer."
this statement is wrong, consider the following code:
$a = 1 + "1234567890123";
var_dump($a); // outputs 'float(1234567890124)' on a 32-bit platform
this means that "1234567890123" was treated as 'float' although it does
not have any of '.', 'e' or 'E' characters.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48496&edit=1