note 101406 deleted from language.operators.comparison by danbrown
| From: | danbrown@php.net | Date: | Wed, 15 Dec 2010 17:33:53 +0000 |
| Subject: | note 101406 deleted from language.operators.comparison by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-174959@lists.php.net to get a copy of this message | ||
Note Submitter: Antti29
----
To mail at markuszeller dot com:
(!$a == 'hello') and ($a != 'hello') are not equal. !$a evaluates to either true
or false, depending on the content of $a, so in essence what the former is doing is checking if
'hello' is true or false, and not a string comparison as (I imagine) you intended. That
should explain the huge difference in performance.