note 31551 deleted from control-structures.switch by cmb
| From: | cmb@php.net | Date: | Thu, 25 Aug 2016 22:18:40 +0000 |
| Subject: | note 31551 deleted from control-structures.switch by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206388@lists.php.net to get a copy of this message | ||
Note Submitter: i luv spam
----
Noticed some odd switch behavior worth mentioning:
Switching on a variable set as $var="08" and forgetting the quotes within the case results
in different behavior depending on the two digit number the variable is set to.
For "01" to "07", using a case like
case 01:
the case is triggered.
For "08" or "09" the case is skipped.
For "10" to "12" the case is triggered.
Looks like something octal may be going on.
Anyway, not a problem once the case is changed to:
case "08":
as it should have been from the start. Just odd.