# 补充\*其他的变更

> 参考：[Other changes](https://secure.php.net/manual/zh/migration71.other-changes.php)

## 其他的变更

### 使用无效字符串进行算术的注意和警告

引入了新的E\_WARNING和E\_NOTICE错误时无效的字符串强制使用运营商预计数字(+ - \* / \* \* % < < > > | & ^)或其等价物。当字符串以数字值开始时，会发出一个E\_NOTICE，但是它包含后面的非数值字符，当字符串不包含数值时，会发出一个E\_WARNING。

```
<?php
'1b' + 'something';
```

以上例程会输出：

```
Notice: A non well formed numeric value encountered in %s on line %d
```

### 警告octal转义序列溢出

以前，3 octet的八进制字符串转义序列将会悄无声息地溢出。现在，它们仍然会溢出，但E\_WARNING将被发出。

```php
<?php
var_dump("\500");
```

以上例程会输出：

```
Warning: Octal escape sequence overflow \500 is greater than \377 in %s on line %d
string(1) "@"
```

矛盾解决`$this`

尽管`$this`被认为是PHP中的一个特殊变量，但是它缺少适当的检查来确保它不用作变量名或重新分配。现在已经纠正了这一点，以确保$ This不能是用户定义的变量，重新分配给不同的值，或者是全球化的。

### 没有哈希的会话ID生成

会话id将不再被哈希生成。有了这一变化，就会导致以下4个ini设置的删除:

* `session.entropy_file`
* `session.entropy_length`
* `session.hash_function`
* `session.hash_bits_per_character`&#x20;

加上以下两个ini设置:

* `session.sid_length`- 定义会话ID的长度，默认为向后兼容的32个字符
* `session.sid_bits_per_character`- 定义每个字符存储的比特数(即增加可以在会话ID中使用的字符的范围)，默认为4以支持向后兼容.

### 更改INI文件处理

精度(precision)

如果值设置为- 1，则使用dtoa模式0。默认值仍然是14。

serialize\_precision

如果值设置为- 1，则使用dtoa模式0。值- 1现在默认使用。

gd.jpeg\_ignore\_warning

这个php的默认值。ini设置已经更改为1，因此默认的libjpeg警告将被忽略。

opcache.enable\_cli

这个php的默认值。在PHP 7.1.2中，ini设置已经更改为1(启用)。

### 只使用CSPRNG的会话ID生成

会话id现在只能用CSPRNG生成。

### 当允许NULL时，更多的信息类型错误消息

**TypeError**exceptions for arg\_info type checks will now provide more informative error messages. If the parameter type or return type accepts`NULL`(by either having a default value of`NULL`or being a nullable type), then the error message will now mention this with a message of "must be ... or null" or "must ... or be null."


---

# 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-qi-ta-de-bian-geng.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.
