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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
