switch case "expecting statement"
Code example:
switch ($test) {
case 'foo':
$dostuff;
break;
case 'bar':
$domore;
break;
}
If I add "case 'baz':" under "case 'foo':" then it displays a code error "Expecting statement" even though 2 case statements is perfectly fine. If I select the whole line for "case 'baz':" then cut/paste, the error disappears.
Please sign in to leave a comment.
Hello,
Could you, please, download and install the latest Early Access Program build from https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program and check if the described issues are still present there?
Just FYI I just updated to 16.2 and it exhibits the same issue. I'll try to look at EAP sometime.
I'm getting a similar problem with 2016.3
I got the same problem adding a default case. Cutting and pasting that part of the case statement fixes the issue.
There were some fixes made for 2017.1 in this regard -- try latest EAP build: https://blog.jetbrains.com/phpstorm/2017/02/phpstorm-2017-1-eap-171-3566/