note 27976 added to language.operators.logical
| From: | Jester at free2code dot net | Date: | Sat, 28 Dec 2002 02:29:00 +0000 |
| Subject: | note 27976 added to language.operators.logical | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41371@lists.php.net to get a copy of this message | ||
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
--
http://www.php.net/manual/en/language.operators.logical.php
http://master.php.net/manage/user-notes.php?action=edit+27976
http://master.php.net/manage/user-notes.php?action=delete+27976
http://master.php.net/manage/user-notes.php?action=reject+27976