PSR-1 - basic coding standard
PSR-1 is the basic coding standard. It outlines the rules our code should follow, as seen by the members of PHP-FIG. The standard itself is quite short.
Files MUST use only <?php and <?= tags. At one time, PHP supported several different tags (<?php ?>
, <? ?>
, <?= ?>
, <% %>
, <%= %>
, <script language="php"></script>
). The use of some depend on the configuration directives short_open_tag
(<? ?>
) and asp_tags
(<% %>
, <%= %>
). The PHP 7 release removed ASP tags (<%
, <%=
), and the script tag (<script language="php">
) altogether. The use of only <?php ?>
and <?= ?>
tags is now recommended in order to maximize compatibility.
Files MUST use only UTF-8 without BOM for PHP code. The byte order mark (BOM) is a Unicode character, U+FEFF BYTE ORDER MARK
(BOM), appearing at the beginning of a document. When used correctly, BOM is invisible. The HTML5 browsers are required to recognize...