# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://phper.shujuwajue.com/phpbian-ma-ji-qiao/phpbian-ma-gui-fan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
