note 1567 deleted from language.operators.comparison by sniper
| From: | sniper@php.net | Date: | Mon, 13 Oct 2003 00:15:29 +0000 |
| Subject: | note 1567 deleted from language.operators.comparison by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58425@lists.php.net to get a copy of this message | ||
Note Submitter: wizzard@wizzard.org
----
These comparison operators work based on the context in which they are being used. So if you want to
compare two strings, but they both happen to be valid numeric values, you're in line to get
burned. The PHP way to compare two strings safely is to use strcmp(). <BR><BR>
P.S. Don't look for this to change in PHP4 either, when I asked Andi Gutmans (the guy who put
the "nd" in Zend), he said the following:
"We don't want to add eq and the likes to PHP because they just add more perl-ish
complexity."