除非類別使用 #[\AllowDynamicProperties]
屬性選擇加入,否則建立動態屬性已被棄用。 stdClass 允許動態屬性。 __get()/__set() 魔術方法的使用不受此變更影響。可以透過以下方式解決動態屬性棄用警告:
#[\AllowDynamicProperties]
屬性新增至類別(也適用於所有子類別)。不為 $callable()
語法接受(但為 call_user_func() 接受)的可呼叫物件已被棄用。特別是:
"self::method"
"parent::method"
"static::method"
["self", "method"]
["parent", "method"]
["static", "method"]
["Foo", "Bar::method"]
[new Foo, "Bar::method"]
"A::method"
或 ["A", "method"]
。
"${var}"
和 "${expr}"
風格的字串插值"${var}"
和 "${expr}"
風格的字串插值已被棄用。請分別使用 "$var"/"{$var}"
和 "{${expr}}"
。
在所有 MBString 函式中,使用 QPrint
、Base64
、Uuencode
和 HTML-ENTITIES
等「文字編碼」已被棄用。與 MBString 支援的所有其他文字編碼不同,這些編碼編碼的不是 Unicode 字碼點序列,而是一系列原始位元組。當指定這些非編碼的其中一個時,大多數 MBString 函式的正確傳回值應該是什麼並不清楚。此外,PHP 具有所有這些編碼的獨立內建實作;例如,可以使用 convert_uuencode()/convert_uudecode() 處理 UUencode 編碼的資料。
內部方法 SplFileInfo::_bad_state_ex() 已被棄用。
utf8_encode() 和 utf8_decode() 已被棄用。