PHP 8.1.28 Released!

其他变更

SAPI 模块变更

Apache2Handler

PHP 模块从 php7_module 重命名为 php_module

函数变更

标准

现在 math 函数 abs()ceil()floor()round() 可以正确的遵循 strict_types 指令。以前,即使在严格类型模式下,也会强制转换第一个参数。

Zip

其他扩展变更

CURL

  • 现在 CURL 扩展要求 libcurl 版本至少为 7.29.0。

  • 移除了 curl_version() 废弃的参数 version

日期/时间

现在 DatePeriod 实现(implements)了 IteratorAggregate(之前是 Traversable)。

DOM

现在 DOMNamedNodeMapDOMNodeList 实现(implements)了 IteratorAggregate(之前是 Traversable)。

国际化

现在 IntlBreakIteratorResourceBundle 实现(implements)了 IteratorAggregate(之前是 Traversable)。

Enchant

现在环境允许时,enchant 会默认使用 libenchant-2。仍然支持 libenchant 1,但已经废弃,并将在未来移除。

GD

JSON

现在无法禁用 JSON 扩展,将是任意 PHP 版本的内置功能,类似 date 扩展。

MBString

更新 Unicode 数据表版本到 13.0.0。

PDO

现在 PDOStatement 实现(implements)了 IteratorAggregate (之前是 Traversable)。

LibXML

现在要求 libxml 最小版本为 2.9.0。这代表着确保了默认情况下禁用了外部实体加载(external entity loading)的功能。无需额外步骤即可防范 XML 外部实体注入攻击(XXE attacks)。

MySQLi/PDO MySQL

PGSQL/PDO PGSQL

PGSQL 与 PDO PGSQL 扩展需要 libpq 的版本号至少为 9.1。

Readline

在交互提示开始之前调用 readline_completion_function()(例如在 auto_prepend_file 中),将重写默认的交互输入补全函数。之前,只有交互提示(interactive prompt)开始后,readline_completion_function() 才会运行。

SimpleXML

现在 SimpleXMLElement 实现(implements)了 RecursiveIterator 并吸收了 SimpleXMLIterator 的功能。SimpleXMLIteratorSimpleXMLElement 的一个空扩展。

INI 文件处理的变更

  • com.dotnet_version 是一个新的 INI 指令,用于选择 dotnet 对象的 .NET framework 版本。

  • zend.exception_string_param_max_len 是一个新的 INI 指令,用于设置字符串化的调用栈(stack strace)的最大字符串长度。

EBCDIC

不再支持 EBCDIC targets,虽然它不太可能还在当初的地方继续运行。

性能

  • opcache 扩展新增了即时编译(JIT)支持。

  • array_slice() 用于没有空隙的数组时,将不会扫描整个数组去查找开始的位移(offset)。在 offset 较大、长度较小时,会显著减少函数的运行时间。

  • 当本地化 LC_CTYPE"C" 时(也是默认值),strtolower() 会使用 SIMD 的实现。

add a note

User Contributed Notes 1 note

up
0
barry dot nelson at amobiledevice dot com
1 year ago
If loading the PHP8 apache module on SuSe Linux, the configuration scripts incorrectly try to load it with automatically generated load statement of:
LoadModule php8_module                     /usr/lib64/apache2/mod_php8.so
This does not work, the patch below fixes the conf file generator...

--- /usr/share/apache2/get_module_list    2023-01-14 22:41:49.586825349 -0500
+++ /usr/share/apache2/get_module_list    2023-01-14 22:42:02.171600410 -0500
@@ -91,4 +91,8 @@
     esac

+    if [ "$module_id" = "php8_module" ]; then
+        module_id="php_module"
+    fi
+
     if [[ -f $module_path ]]; then
         printf "LoadModule %-30s %s\n" $module_id $module_path >&3
To Top