note 18819 deleted from control-structures.switch by cmb
| From: | cmb@php.net | Date: | Thu, 25 Aug 2016 22:18:58 +0000 |
| Subject: | note 18819 deleted from control-structures.switch by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206389@lists.php.net to get a copy of this message | ||
Note Submitter: PeterC at (spamme)rm-rfsplat dot com
----
Along the lines of using expressions in switch statements. I came across some code which wrapped
switch statements in 'if' blocks like so...
if (isset($var) {
switch($var) {
....
But I found the following a little cleaner.
switch ( isset($var) ? $var : defaultValue ) {
...