Bug #67757 [NEW]: multiple default cases
| From: | php at tutteli dot ch | Date: | Mon, 04 Aug 2014 12:31:31 +0000 |
| Subject: | Bug #67757 [NEW]: multiple default cases | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-186960@lists.php.net to get a copy of this message | ||
From: php at tutteli dot ch
Operating system:
PHP version: 5.5.15
Package: *General Issues
Bug Type: Bug
Bug description:multiple default cases
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 bug report at https://bugs.php.net/bug.php?id=67757&edit=1
--