Difference between revisions of "Short Tags and PHP 6"
Docs admin (Talk | contribs) (test) |
(No difference)
|
Revision as of 19:35, 28 September 2012
Within a PHP script, PHP code is enclosed by PHP tags. The opening tag and the closing tag ?> tell the PHP interpretter that everything in between should be identified as PHP code. However, PHP also supports variations of these tags known as "short tags".
The opening short tag can be used instead of the long form . Functionally, there's no difference between these two tags, the former simply saves you from typing a few more characters.
PHP also supports a short tag that will indicate the following code should be printed. The short tag is equivalent to typing the long form . Again, these two forms perform the same functionality, but the short tag improves readability and saves on typing.
These two examples are functionally equivalent:
Here at Acenet, short tags are enabled on all of our shared servers by default. However, in new installations of PHP 5.3, short tags are disabled by default in the php.ini. If you administer your own server and wish to enable short tags, open your server's php.ini and set this value: