ID: 9186
User Update by: [EMAIL PROTECTED]
Status: Analyzed
Bug Type: Documentation problem
Description: string compare with "==" does not work correctly
The conversation is useful. I know this because HTML form
parameters, MySQL result sets are strings even if they are
represent numbers.
But there some cases for which the conversation is not
useful. If the result is MAXINT, MININT or NaN, it would
be better not converting the operands and making a
string comparision. A warning message whould be also
useful.
Previous Comments:
---------------------------------------------------------------------------
[2001-02-15 05:25:09] [EMAIL PROTECTED]
this autoconversion is usefull when dealing with html form input
(for which php is used every once in a while afaik :)
as html has no numric input elements, just text
maybe it would make sense to have this behaviour configurable
in the ini file, but i'm afraid that this would only increase the WTF
factor even more
---------------------------------------------------------------------------
[2001-02-15 05:07:35] [EMAIL PROTECTED]
Ok, I accept this. But I don't think that is a good idea
to compare apples with pears with the answer 'yes they are
fruit' without any warning.
---------------------------------------------------------------------------
[2001-02-15 04:32:00] [EMAIL PROTECTED]
Ok, it should remain open as a documentation problem...
---------------------------------------------------------------------------
[2001-02-15 04:31:01] [EMAIL PROTECTED]
This is a defined behavior (and does have strong reasons). It's not a bug.
If you're interested in a byte-by-byte string comparison, you should use strcmp().
---------------------------------------------------------------------------
[2001-02-09 11:10:17] [EMAIL PROTECTED]
Incorrectly flagged as bogus.
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the
comments, please view the bug report online.
Full Bug description available at: http://bugs.php.net/?id=9186
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]