Bug #67757 [Opn]: multiple default cases
| From: | aharvey@php.net | Date: | Tue, 05 Aug 2014 19:19:16 +0000 |
| Subject: | Bug #67757 [Opn]: multiple default cases | ||
| References: | 1 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-348@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67757&edit=1
ID: 67757
Updated by: aharvey@php.net
Reported by: php at tutteli dot ch
Summary: multiple default cases
Status: Open
Type: Bug
-Package: *General Issues
+Package: PHP Language Specification
PHP Version: 5.5.15
Block user comment: N
Private report: N
New Comment:
This is probably an issue with the spec, then: AIUI, the spec should be documenting what 5.6 does at
present.
Previous Comments:
------------------------------------------------------------------------
[2014-08-04 12:31:30] php at tutteli dot ch
Description:
------------
PHP allows to define multiple default cases in a switch. According to the spec this should not be
allowed:
https://github.com/php/php-langspec/blob/master/spec/11-statements.md#the-s
witch-statement
Test script:
---------------
<?
$a=1;
$b=0;
switch($a) {
default:
$b += 1;
break;
default:
$b += 2;
}
echo $b; //output would be 2
?>
Expected result:
----------------
parser syntax error
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67757&edit=1