Bug #10437 Updated: casting is not consistent
| From: | jeroen@php.net | Date: | Sat, 19 May 2001 21:22:32 +0000 |
| Subject: | Bug #10437 Updated: casting is not consistent | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-55918@lists.php.net to get a copy of this message | ||
ID: 10437
Updated by: jeroen
Reported By: goba@php.net
Old-Status: Open
Status: Analyzed
Bug Type: Strings related
Operating system:
PHP Version: 4.0.4pl1
Assigned To:
Comments:
Strange indeed.
There are explicit casts (either to double or to int)
and implicit casts.
You can view upon the latter one as a (number) cast,
it casts to a number, maybe int, maybe float.
In that cast strings like '5.31abc' are not detected as double, (invaled numbers after the
dot) so integer parsing takes place, which yields the int 5.
This should be corrected in Zend.
Previous Comments:
---------------------------------------------------------------------------
[2001-04-22 04:06:03] goba@php.net
Casting is not consistent with doubles:
$foo = "5.31abc";
$foo2 = (double) $foo;
$foo3 = $foo + 0;
The first gives 5.31 the second gives 5,
although it should notice the full 5.31 number
in the string.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10437&edit=2