# 第三章、使用 PHP 函数

在本章中，我们将讨论以下主题：

* 函数开发
* 数据类型提示
* 使用返回值数据类型
* 使用迭代器
* 使用生成器编写自己的迭代器

## 引言

在本章中，我们将考虑利用 PHP 的**函数式编程能力**的示例。函数式编程，或者说**程序化编程**，是PHP代码在PHP第4版引入**面向对象编程**（**OOP**）之前的传统编写方式。函数式编程是一种编程范式—一种构建计算机程序结构和元素的风格—它将计算视为数学函数的评估，并避免改变状态和可变数据。然后这个文件可以包含在任何未来的脚本中，允许随意调用定义的函数。


---

# 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://ganymedenil.gitbook.io/php-7/mo-kuai-yi/di-san-zhang-shi-yong-php-han-shu.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.
