note 53401 added to language.control-structures
| From: | edmundathaselwanterdotcom at osu1 dot php dot net | Date: | Tue, 31 May 2005 17:25:01 +0000 |
| Subject: | note 53401 added to language.control-structures | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89685@lists.php.net to get a copy of this message | ||
note to the posting from "dotwho at nospam dot mac dot com":
Sure this is the expected behaviour. and/or binds weaker than ? : binds weaker than &&/||.
So if you write:
x and y ? a : b; you get x and (y ? a : b);
And if you write
x && y ? a : b; you get (x && y) ? a : b;
You have got the point?
I suggest to always add parentheses to make things clear, first for the interpreter/compiler and
second for all the people reading ones code :-)
----
Manual Page -- http://www.php.net/manual/en/language.control-structures.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53401
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53401&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53401&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53401&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53401&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53401&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53401&report=yes
Search -- http://master.php.net/manage/user-notes.php