PHP 8.2 新特性之 新增方法与弃用相关的操作
hi,我是温新,一名 PHPer
新增类、接口和函数
-
新增
mysqli_execute_query函数和mysqli::execute_query方法。 -
新增
#[\AllowDynamicProperties\]和#[\SensitiveParameter\]属性。 -
新增
ZipArchive::getStreamIndex、ZipArchive::getStreamName和ZipArchive::clearError方法。 -
新增
ReflectionFunction::isAnonymous和ReflectionMethod::hasPrototype方法。 -
新增
curl_upkeep、memory_reset_peak_usage、ini_parse_quantity、libxml_get_external_entity_loader、sodium_crypto_stream_xchacha20_xor_ic和openssl_cipher_key_length方法。
弃用和向后不兼容
-
弃用
${}字符串插值。 -
弃用
utf8_encode和utf8_decode函数。 -
ODBC和PDO_ODBC扩展转义用户名和密码。 -
strtolower和strtoupper函数不再对语言环境敏感。 -
SplFileObject::getCsvControl、SplFileObject::fflush、SplFileObject::ftell、SplFileObject::fgetc和SplFileObject::fpassthru方法强制执行它们的签名。 -
内置方法
SplFileInfo::_bad_state_ex已被废弃。 -
SplFileObject::hasChildren方法暂定返回类型为false。 -
SplFileObject::getChildren方法暂定返回类型为null。 -
DateTime::createFromImmutable和DateTimeImmutable::createFromMutable方法暂定返回类型为static。