note 111645 deleted from language.basic-syntax.phptags by salathe
| From: | salathe@php.net | Date: | Tue, 02 Aug 2016 12:02:34 +0000 |
| Subject: | note 111645 deleted from language.basic-syntax.phptags by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206162@lists.php.net to get a copy of this message | ||
Note Submitter: preda dot vlad at yahoo dot com
----
So here are the valid ways to open PHP tags:
<?php ?> // standard tags
<? ?> // short tags, need short_open_tag enabled in php.ini
<% %> // asp tags, need asp_tags enabled in php.ini
<script language="php"> </script> // case insensitive
PSR-1 coding standards suggest to only use <?php ?> or <?= ?> (echo short tags) - and no
other variations, and PSR-2 suggests to not close the tags in PHP only files.