# 补充\*变更的函数

> 参考：[Changed functions](https://secure.php.net/manual/zh/migration71.changed-functions.php)

## 变更的函数

### PHP Core

* [getopt()](https://php.net/manual/zh/function.getopt.php) 有一个可选的第三个参数，在参数向量列表中显示下一个元素的索引。这是通过一个by ref参数完成的。
* [getenv()](https://php.net/manual/zh/function.getenv.php) 不再需要它的参数。如果忽略了参数，那么当前的环境变量将作为关联数组返回。
* [get\_headers()](https://php.net/manual/zh/function.get-headers.php) 现在有了一个附加的参数来启用自定义流上下文。\
  [long2ip()](https://php.net/manual/zh/function.long2ip.php) 现在还可以接受整数作为参数。
* [output\_reset\_rewrite\_vars()](https://php.net/manual/zh/function.output-reset-rewrite-vars.php) 不再重新设置会话URL重写变量。
* [parse\_url()](https://php.net/manual/zh/function.parse-url.php) 现在的限制更多，支持RFC3986。
* [unpack()](https://php.net/manual/zh/function.unpack.php) 现在接受一个可选的第三个参数来指定开始解包的偏移量。

### File System

* [file\_get\_contents()](https://php.net/manual/zh/function.file-get-contents.php) now accepts a negative seek offset if the stream is seekable.
* [tempnam()](https://php.net/manual/zh/function.tempnam.php) 现在，在返回系统的临时目录时发出通知。

### JSON

* [json\_encode()](https://php.net/manual/zh/function.json-encode.php) 现在接受一个新选项，`JSON_UNESCAPED_LINE_TERMINATORS`

  ,禁用 U+2028 和 U+2029 字符串的转义 当`JSON_UNESCAPED_UNICODE　被提供`.

### Multibyte String

* [mb\_ereg()](https://php.net/manual/zh/function.mb-ereg.php)　现在拒绝非法字节序列。
* [mb\_ereg\_replace()](https://php.net/manual/zh/function.mb-ereg-replace.php)　现在拒绝非法字节序列。

### PDO

* [PDO::lastInsertId()](https://php.net/manual/zh/pdo.lastinsertid.php)　对于PostgreSQL，当nextval没有调用当前会话(postgres连接)时，将触发一个错误。

### PostgreSQL

* [pg\_last\_notice()](https://php.net/manual/zh/function.pg-last-notice.php)　现在接受一个可选参数来指定操作。这可以通过以下新常量之一来完成: PGSQL\_NOTICE\_LAST, PGSQL\_NOTICE\_ALL, or PGSQL\_NOTICE\_CLEAR.

  .
* [pg\_fetch\_all()](https://php.net/manual/zh/function.pg-fetch-all.php)　现在接受一个可选的第二个参数来指定结果类型(类似于[pg\_fetch\_array()](https://php.net/manual/zh/function.pg-fetch-array.php)的第三个参数)。
* [pg\_select()](https://php.net/manual/zh/function.pg-select.php)　现在接受一个可选的第四个参数来指定结果类型(类似于[pg\_fetch\_array()](https://php.net/manual/zh/function.pg-fetch-array.php)的第三个参数)。


---

# 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://php7.shujuwajue.com/php-71x-xin-te-xing/bu-5145-bian-geng-de-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.
