You should always use <?php ?> tags or short-echo tags <?= ?>. Other variations (in particular, short tags <? ?>) should not be used as they are commonly disabled by system administrators.
When a file is not expected to produce output (the entire file is PHP code) the closing ?>...