I think the problem is the tendency to switch back and forth between <?php and <?. If short_tags is turned off (because it has been deprecated), then the bits between <?...?> will be ignored by the parser, and that would cause problems. Indeed, replacing <? with <?php clears the error.