Short Tags¶
PHP uses special tags to identify code that has to be executed. The short tags are a special set of PHP tag, shorter than the usual <?php. It was simply <?.
Short tags may be disabled in PHP configuration, with the short_open_tag directive.
Short tags are different from echo tags: those tags immediately display data.
From the manual: As short tags can be disabled it is recommended to only use the normal tags <?php ?> and <?= ?> to maximise compatibility.
<?php
echo 1;
?>
<?
// this is a short tag
echo 2;
?>
See also PHP RFC: Deprecate short open tags, again.
Related : PHP Tags, Echo Tag, Open Tag, Close Tag, Operators