I seems like whitespaces are not allowed in switch alternative syntax.
This makes it hard to keep proper indented code when using php as a “template engine”
<?php ?>
<?php switch ($i): ?>
<?php case 1: ?>
<div>HTML</div>
<?php break; ?>
<?php case 2: ?>
<div>Other HTML</div>
<?php break; ?>
<?php endswitch; ?>
<?php ?>
This will output
Parse error: syntax error, unexpected T_INLINE_HTML, expecting T_ENDSWITCH or T_CASE or T_DEFAULT
Do i have to use if statements to solve this, or do you guys have any other solutions rather than having to break my nicely indented code