#48496 [NEW]: String to numerical conversion
| From: | headden at karelia dot ru | Date: | Mon, 08 Jun 2009 14:31:10 +0000 |
| Subject: | #48496 [NEW]: String to numerical conversion | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-2352@lists.php.net to get a copy of this message | ||
From: headden at karelia dot ru
Operating system: Irrelevant
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: String to numerical conversion
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 bug report at http://bugs.php.net/?id=48496&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48496&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48496&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48496&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48496&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48496&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48496&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48496&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48496&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48496&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48496&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48496&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48496&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48496&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48496&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48496&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48496&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48496&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48496&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48496&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48496&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48496&r=mysqlcfg