Bug #5404 Updated: String conversion to integer is incorrect
| From: | zeev@php.net | Date: | Sun, 06 May 2001 12:49:06 +0000 |
| Subject: | Bug #5404 Updated: String conversion to integer is incorrect | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-54093@lists.php.net to get a copy of this message | ||
ID: 5404
Updated by: zeev
Reported By: kix@struktuur.ee
Old-Status: Analyzed
Status: Closed
Bug Type: Scripting Engine problem
Operating system:
PHP Version: 4.0.1
Assigned To:
Comments:
Fixed at last - thanks for the report!
Previous Comments:
---------------------------------------------------------------------------
[2000-08-05 12:27:47] stas@php.net
Yes, strtod makes mess from 0x-numbers (I suspect it being libc bug, but maybe they intended it to
be so), so we should catch them in strtol.
---------------------------------------------------------------------------
[2000-08-05 04:28:40] kix@struktuur.ee
Yes, of course, sorry about the typo.
It seems to me that the place where this is done in such a way is in the function
is_numeric_string() in the file zend_operators.*
---------------------------------------------------------------------------
[2000-08-04 23:36:30] hholzgra@php.net
you're talking about strtol() here, not strtod(), aren't you?
---------------------------------------------------------------------------
[2000-08-04 01:50:38] kix@struktuur.ee
No, it is not necessary to create a new strtod function, because when php checks if the string is a
number or not it explicitly tells strtod, that the string is a base 10 number, instead of letting
strtod determine the base itself, which would result in the correct behaviour.
---------------------------------------------------------------------------
[2000-08-03 21:52:51] hholzgra@php.net
so maybe we should add some kind of
strtod-wrapper to get around this libc 'feature'?
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=5404&edit=2