Re: Bug #786 Updated: Incorrect expression evaluation
| From: | Lars Torben Wilson | Date: | Fri, 25 Sep 1998 19:42:13 +0000 |
| Subject: | Re: Bug #786 Updated: Incorrect expression evaluation | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-1510@lists.php.net to get a copy of this message | ||
Bug Database writes:
> ID: 786
> Updated by: zeev
> Reported By: torben@coastnet.com
> Status: Closed
> Bug Type: Performance problem
> Assigned To:
> Comments:
>
> When one the arguments to a comparison operator is a number,
> or a string that looks like a number, the comparison is
> done numerically. In this case, 'r' is converted to a 0
> (like any other non-numeric string), and thus the comparison
> evaluates to TRUE.
>
> If you know you want a string comparison, you should use
> strcmp() instead.
>
> Full Bug description available at:
> http://ca.php.net/bugs.php3?id=786
3 AM brainfart from hell, there. Had I just remembered what I wrote in
the Type Juggling chapter...*sigh*...
Thanks
Torben
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net