note 38890 deleted from control-structures.switch by cmb
| From: | cmb@php.net | Date: | Sun, 21 Apr 2019 11:49:55 +0000 |
| Subject: | note 38890 deleted from control-structures.switch by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210640@lists.php.net to get a copy of this message | ||
Note Submitter: phpmanual at nos-pam dot sadlittleboy dot com
----
Regarding bishop's comment below, although using:
switch($bug === 0 ? '' : $bug) {
may work, ( and although I do like the ternary operator, :) it might be more intuitive/readable to
use this instead:
switch( (string)$bug ) {
which typecasts the variable to a string to ensure that "0" will be handled correctly.