The parser expects a T_CASE token but finds the newline after switch($data['type']) : ?>
.
switch (1) : ?> <? case 1: break; endswitch;
gives a parse error and so does
switch (1) : ?>\n<? case 1: break; endswitch;
while
switch (1) : ?><? case 1: break; endswitch;
does not. ;-)