note 27976 deleted from language.operators.logical by betz
| From: | betz@php.net | Date: | Mon, 01 Nov 2004 14:04:26 +0000 |
| Subject: | note 27976 deleted from language.operators.logical by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79444@lists.php.net to get a copy of this message | ||
Note Submitter: Jester at free2code dot net
----
Don't make the same mistake I did.
if ($a | $b)
Is NOT the same as:
if ($a || $b)
I thought | was the same thing as || for a long time and noticed strange behaviour sometimes (I did
the same thing with & and &&), I never knew why strange things happened sometimes until
I read this.
Check out the bitwise operators (http://www.php.net/manual/en/language.operators.bitwise.php) to see
the difference.
-Jester | http://www.free2code.net