Here's the information according to the official documentation:
There are four different pairs of opening and closing tags which can be used in PHP. Two of those,
<?php ?>
and<script language="php"> </script>
, are always available. The other two are short tags and ASP style tags, and can be turned on and off from the php.ini configuration file. As such, while some people find short tags and ASP style tags convenient, they are less portable, and generally not recommended.
In my experience most servers do have short tags enabled. Typing
<?=
is far more convenient than typing
<?php echo
The programmers convenience is an important factor, so why are they not recommended?
转载于:https://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use