我的IDE(PHPstorm)检测到错误,但它没有提供任何有用的纠正上下文.将文件作为模板包含时,代码肯定会产生致命错误.
手册页的警告:
Warning Any output (including whitespace) between a switch statement and the first case will result in a Syntax error. For example,this is invalid:
<?PHP switch ($foo): ?> <?PHP case 1: ?> ... <?PHP endswitch ?>
Whereas this is valid,as the trailing newline after the switch statement is considered part of the closing ?> and hence nothing is output between the switch and case:
<?PHP switch ($foo): ?> <?PHP case 1: ?> ... <?PHP endswitch ?>
手册页没有提供任何解释.一些用户comments on the page也没有解释任何事情;他们只是重申不允许有空格.
为什么这是语法错误?