> For the complete documentation index, see [llms.txt](https://phper.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://phper.shujuwajue.com/phpbian-ma-ji-qiao/phpbian-ma-gui-fan.md).

# PHP编码规范

1. PHP代码文件必须以 \<?php 或 \<?= 标签开始；
2. PHP代码文件必须以 不带BOM的 UTF-8 编码；
3. PHP代码中应该只定义类、函数、常量等声明，或其他会产生 从属效应 的操作，二者只能选其一；
4. 命名空间以及类必须符合 PSR 的自动加载规范：PSR-4；
5. 类的命名必须遵循 StudlyCaps 大写开头的驼峰命名规范；
6. 类中的常量所有字母都必须大写，单词间用下划线分隔；
7. 方法名称必须符合 camelCase 式的小写开头驼峰命名规范。

[PHP编码规范（中文版）导读](https://github.com/PizzaLiu/PHP-FIG)
