note 78636 added to language.expressions
| From: | petruzanauticoyahoo?com!ar at osu1 dot php dot net | Date: | Sat, 20 Oct 2007 15:41:35 +0000 |
| Subject: | note 78636 added to language.expressions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131583@lists.php.net to get a copy of this message | ||
Regarding the ternary operator, I would rather say that the best option is to enclose all the
expression in parantheses, to avoid errors and improve clarity:
<?php
print ( $a > 1 ? "many" : "just one" );
?>
PS: for php, C++, and any other language that has it.
----
Server IP: 201.216.232.3
Probable Submitter: 24.232.22.244
----
Manual Page -- http://www.php.net/manual/en/language.expressions.php
Edit -- https://master.php.net/note/edit/78636
Del: integrated -- https://master.php.net/note/delete/78636/integrated
Del: useless -- https://master.php.net/note/delete/78636/useless
Del: bad code -- https://master.php.net/note/delete/78636/bad+code
Del: spam -- https://master.php.net/note/delete/78636/spam
Del: non-english -- https://master.php.net/note/delete/78636/non-english
Del: in docs -- https://master.php.net/note/delete/78636/in+docs
Del: other reasons-- https://master.php.net/note/delete/78636
Reject -- https://master.php.net/note/reject/78636
Search -- https://master.php.net/manage/user-notes.php