note 92390 added to language.operators.precedence
| From: | AnManmichel at eserviciosat dot net | Date: | Wed, 22 Jul 2009 20:15:28 +0000 |
| Subject: | note 92390 added to language.operators.precedence | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158588@lists.php.net to get a copy of this message | ||
This table isn't totally right:
The manual reads: <<The reason for the two different variations of "and" and
"or" operators is that they operate at different precedences. (See Operator
Precedence.)>>
After you see at the "Operator Precedence table" one reads:
operator -> precedence
----------------------------
&& -> left
and -> left
I believe && should have right precedence, please see the following example :
$ php -a
Interactive shell
php > $a = true and false;
php > var_dump($a);
bool(true)
php > $a = true && false;
php > var_dump($a);
bool(false)
php > $a = (true and false);
php > var_dump($a);
bool(false)
----
Server IP: 200.35.200.6
Probable Submitter: 190.201.79.218
----
Manual Page -- http://www.php.net/manual/en/language.operators.precedence.php
Edit -- https://master.php.net/note/edit/92390
Del: integrated -- https://master.php.net/note/delete/92390/integrated
Del: useless -- https://master.php.net/note/delete/92390/useless
Del: bad code -- https://master.php.net/note/delete/92390/bad+code
Del: spam -- https://master.php.net/note/delete/92390/spam
Del: non-english -- https://master.php.net/note/delete/92390/non-english
Del: in docs -- https://master.php.net/note/delete/92390/in+docs
Del: other reasons-- https://master.php.net/note/delete/92390
Reject -- https://master.php.net/note/reject/92390
Search -- https://master.php.net/manage/user-notes.php