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, ...

Get Mastering PHP 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.