Bug #76116 [Opn->Nab]: Switch can include if()-statment instead of "case" or "default"
| From: | peehaa@php.net | Date: | Mon, 19 Mar 2018 17:25:41 +0000 |
| Subject: | Bug #76116 [Opn->Nab]: Switch can include if()-statment instead of "case" or "default" | ||
| References: | 1 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-1323@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76116&edit=1
ID: 76116
Updated by: peehaa@php.net
Reported by: rei-ayanami at gmx dot net
Summary: Switch can include if()-statment instead of "case"
or "default"
-Status: Open
+Status: Not a bug
Type: Bug
Package: PHP Language Specification
Operating System: Windows 10
PHP Version: 7.2Git-2018-03-19 (Git)
Block user comment: N
Private report: N
New Comment:
This is not a bug dead code is not a syntax error. Syntax errors are used when there is an error in
the syntax.
Previous Comments:
------------------------------------------------------------------------
[2018-03-19 17:20:52] rei-ayanami at gmx dot net
Description:
------------
By mistake (wrong line) I have set a if() within a switch. Example:
$var = 2;
switch ($var)
{
case 1: break;
if ($var==2)
{
die('here');
}
}
But that results not in a syntax error. That if() will never execute, so its useless code. Maybe
thats not a bug, but it would help to find stupid input errors. Thanks :)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76116&edit=1