Re: switch statement and multiple default cases
| From: | Andrea Faulds | Date: | Mon, 04 Aug 2014 12:25:00 +0000 |
| Subject: | Re: switch statement and multiple default cases | ||
| References: | 1 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-311@lists.php.net to get a copy of this message | ||
On 4 Aug 2014, at 10:49, Robert Stoll <php@tutteli.ch> wrote:
> The spec states "There must be at most one default label." [1] which is
> surely the right way to go IMO but not even the PHP implementation (5.5.9)
> behaves like this and the following is perfectly valid:
> Should I report a bug?
A bug in php.net PHP? Sure, there’s no good reason to allow both. In the standard? No, not really.
It’s only because of implementation bugginess that this is even ‘permitted’.
--
Andrea Faulds
http://ajf.me/