其他變更

SAPI 模塊的變更

Apache2Handler

PHP 模塊從 php7_module 重命名為 php_module。

Function 的變更

Reflection

可通過新參數(shù) filter 來過濾 ReflectionClass::getConstants()ReflectionClass::getReflectionConstants() 的返回結(jié)果。 新增三個常量,搭配使用:

  • ReflectionClassConstant::IS_PUBLIC
  • ReflectionClassConstant::IS_PROTECTED
  • ReflectionClassConstant::IS_PRIVATE

Zip

其他擴(kuò)展變更

CURL

  • 現(xiàn)在 CURL 擴(kuò)展要求 libcurl 版本至少為 7.29.0。

  • 移除了 curl_version() 廢棄的參數(shù) version。

日期/時間

現(xiàn)在 DatePeriod 實(shí)現(xiàn)(implements)了 IteratorAggregate (之前是 Traversable)。

DOM

現(xiàn)在 DOMNamedNodeMapDOMNodeList 實(shí)現(xiàn)(implements)了 IteratorAggregate (之前是 Traversable)。

國際化

現(xiàn)在 IntlBreakIteratorResourceBundle 實(shí)現(xiàn)(implements)了 IteratorAggregate (之前是 Traversable)。

Enchant

現(xiàn)在環(huán)境允許時,enchant 會默認(rèn)使用 libenchant-2。 仍然支持 libenchant 1,但已經(jīng)廢棄,并將在未來移除。

GD

JSON

現(xiàn)在無法禁用 JSON 擴(kuò)展,將是任意 PHP 版本的內(nèi)置功能,類似 date 擴(kuò)展。

MBString

更新 Unicode 數(shù)據(jù)表版本到 13.0.0。

PDO

現(xiàn)在 PDOStatement 實(shí)現(xiàn)(implements)了 IteratorAggregate (之前是 Traversable)。

LibXML

現(xiàn)在要求 libxml 最小版本為 2.9.0。 這代表著確保了默認(rèn)情況下禁用了外部實(shí)體加載(external entity loading)的功能。 無需額外步驟即可防范 XML 外部實(shí)體注入攻擊(XXE attacks)。

MySQLi / PDO MySQL

  • 未使用 mysqlnd 時(也是默認(rèn)且推薦的做法), 支持的最小 libmysqlclient 版本為 5.5。

  • 現(xiàn)在 mysqli_result 實(shí)現(xiàn)(implements)了 IteratorAggregate (之前是 Traversable)。

PGSQL / PDO PGSQL

PGSQL 與 PDO PGSQL 擴(kuò)展需要 libpq 的版本號至少為 9.1。

Readline

在交互提示開始之前調(diào)用 readline_completion_function() (例如在 auto_prepend_file 中), 將重寫默認(rèn)的交互輸入補(bǔ)全函數(shù)。 之前,只有交互提示(interactive prompt)開始后, readline_completion_function() 才會運(yùn)行。

SimpleXML

現(xiàn)在 SimpleXMLElement 實(shí)現(xiàn)(implements)了 RecursiveIterator 并吸收了 SimpleXMLIterator 的功能。 SimpleXMLIteratorSimpleXMLElement 的一個空擴(kuò)展。

INI 文件處理的變更

  • com.dotnet_version 是一個新的 INI 指令,用于選擇 dotnet 對象的 .NET framework 版本。

  • zend.exception_string_param_max_len 是一個新的 INI 指令,用于設(shè)置字符串化的調(diào)用棧(stack strace)的最大字符串長度。

EBCDIC

不再支持 EBCDIC targets,雖然它不太可能還在當(dāng)初的地方繼續(xù)運(yùn)行。

性能

  • opcache 擴(kuò)展新增了即時編譯(JIT) 支持。

  • array_slice() 用于沒有空隙的數(shù)組時, 將不會掃描整個數(shù)組去查找開始的位移(offset)。 在 offset 較大、長度較小時,會顯著減少函數(shù)的運(yùn)行時間。

  • 當(dāng)本地化 LC_CTYPE"C" 時(也是默認(rèn)值), strtolower() 會使用 SIMD 的實(shí)現(xiàn)。