PHP 8.6 Codex Changelog
| Newly added | Improvements | Changed | Deprecations | Removals | |
|---|---|---|---|---|---|
| INI Directives | 1 | ‧ | 3 | ‧ | ‧ |
| Classes | 24 | ‧ | 1 | ‧ | ‧ |
| Constants | 34 | ‧ | 3 | 2 | ‧ |
| Functions | 14 | 26 | ‧ | 26 | ‧ |
| Enums | 14 | ‧ | ‧ | ‧ | ‧ |
| Interfaces | 1 | ‧ | ‧ | ‧ | ‧ |
Changed
INI Directives
Global
session.cookie_httponlyINI directive default value changed from
0to1session.use_strict_modeINI directive default value changed from
0to1session.cookie_samesiteINI directive default value set to
Lax
Classes
ext-soap
SoapClientCloning class objects is no longer allowed
Constants
gd
GD_VERSIONConstant value changed from
2.0.35to2.4.0GD_RELEASE_VERSIONConstant value changed from
35to0GD_MINOR_VERSIONConstant value changed from
0to4
Newly added
INI Directives
Global
error_include_argsINI directive added
Constants
curl
CURL_READFUNC_ABORTConstant added
CURL_SEEKFUNC_CANTSEEKConstant added
CURL_SEEKFUNC_FAILConstant added
CURL_SEEKFUNC_OKConstant added
CURLINFO_SIZE_DELIVEREDConstant added
CURLOPT_SEEKFUNCTIONConstant added
mysqli
MYSQLI_OPT_COMPRESSConstant added
openssl
OPENSSL_RSA_PSS_SALTLEN_AUTOConstant added
OPENSSL_RSA_PSS_SALTLEN_DIGESTConstant added
OPENSSL_RSA_PSS_SALTLEN_MAXConstant added
pgsql
PGSQL_CONNECTION_SSL_STARTUPConstant added
sockets
EAI_CANCELEDConstant added
AF_UNSPECConstant added
TCP_USER_TIMEOUTConstant added
EAI_ADDRFAMILYConstant added
EAI_AGAINConstant added
EAI_ALLDONEConstant added
EAI_BADFLAGSConstant added
EAI_FAILConstant added
EAI_SOCKTYPEConstant added
EAI_SERVICEConstant added
EAI_OVERFLOWConstant added
EAI_NOTCANCELEDConstant added
EAI_NONAMEConstant added
EAI_NODATAConstant added
EAI_INTRConstant added
EAI_INPROGRESSConstant added
EAI_IDN_ENCODEConstant added
EAI_FAMILYConstant added
EAI_SYSTEMConstant added
standard
STREAM_CRYPTO_STATUS_NONEConstant added
ARRAY_FILTER_USE_VALUEConstant added
STREAM_CRYPTO_STATUS_WANT_READConstant added
STREAM_CRYPTO_STATUS_WANT_WRITEConstant added
Classes
ext-date
Time\DurationClass added
Time\TimeExceptionException class added
ext-intl
IntlNumberRangeFormatterClass added
ext-openssl
Openssl\OpensslExceptionException class added
Openssl\PskClass added
Openssl\SessionClass added
Core
StreamErrorClass added
StreamExceptionException class added
StreamPollHandleClass added
Io\Poll\HandleAlreadyWatchedExceptionException class added
Io\IoExceptionException class added
Io\Poll\BackendUnavailableExceptionException class added
Io\Poll\ContextClass added
Io\Poll\FailedContextInitializationExceptionException class added
Io\Poll\FailedHandleAddExceptionException class added
Io\Poll\FailedPollOperationExceptionException class added
Io\Poll\FailedPollWaitExceptionException class added
Io\Poll\FailedWatcherModificationExceptionException class added
Io\Poll\InactiveWatcherExceptionException class added
Io\Poll\InvalidHandleExceptionException class added
Io\Poll\PollExceptionException class added
Io\Poll\WatcherClass added
ext-uri
Uri\Rfc3986\UriBuilderClass added
Uri\WhatWg\UrlBuilderClass added
Functions
ext-gmp
gmp_prevprimeFunction added
gmp_powm_secFunction added
ext-intl
locale_get_display_keywordFunction added
grapheme_strrevFunction added
locale_get_display_keyword_valueFunction added
ext-mysqli
mysqli_quote_stringFunction added
ext-snmp
snmp_set_output_optionFunction added
snmp_init_mibFunction added
snmp_set_mib_optionFunction added
snmp_set_string_output_formatFunction added
Core
stream_socket_get_crypto_statusFunction added
stream_last_errorsFunction added
stream_clear_errorsFunction added
clampFunction added
Enums
ext-snmp
Snmp\MibEnum added
Snmp\OidOutputEnum added
Snmp\OutputEnum added
Snmp\StringOutputEnum added
Core
StreamErrorCodeEnum added
StreamErrorModeEnum added
StreamErrorStoreEnum added
SortDirectionEnum added
SortDirectionEnum added
Io\Poll\BackendEnum added
Io\Poll\EventEnum added
ext-uri
Uri\Rfc3986\UriHostTypeEnum added
Uri\Rfc3986\UriTypeEnum added
Uri\WhatWg\UrlHostTypeEnum added
Interfaces
Core
Io\Poll\HandleInterface added
Improvements
Functions
ext-gd
imageaffinematrixgetParameter type added for parameter #2 (
$options):array|float- imageaffinematrixget(int $type, $options): array|false + imageaffinematrixget(int $type, array|float $options): array|false
ext-json
json_decodejson_last_error_msgext-ldap
ldap_free_resultReturn type changed:
booltotrue- ldap_free_result(LDAP\Result $result): bool + ldap_free_result(LDAP\Result $result): true
ext-openssl
openssl_sign- Optional parameter added - #6:
int $salt_length = OPENSSL_RSA_PSS_SALTLEN_AUTO
openssl_sign( string $data, &$signature, $private_key, string|int $algorithm = OPENSSL_ALGO_SHA1, - int $padding = 0 + int $padding = 0, + int $salt_length = OPENSSL_RSA_PSS_SALTLEN_AUTO ): boolopenssl_encryptParameter type changed for parameter #7 (
$aad):stringto?stringopenssl_encrypt( string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", &$tag = null, - string $aad = "", + ?string $aad = "", int $tag_length = 16 ): string|falseopenssl_decryptParameter type changed for parameter #7 (
$aad):stringto?stringopenssl_decrypt( string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", ?string $tag = null, - string $aad = "" + ?string $aad = "" ): string|falseopenssl_verify- Optional parameter added - #6:
int $salt_length = OPENSSL_RSA_PSS_SALTLEN_AUTO
openssl_verify( string $data, string $signature, $public_key, string|int $algorithm = OPENSSL_ALGO_SHA1, - int $padding = 0 + int $padding = 0, + int $salt_length = OPENSSL_RSA_PSS_SALTLEN_AUTO ): int|falseext-pgsql
pg_close_stmtParameter type changed for parameter #1 (
$connection):Pgsql\ConnectiontoPgSql\Connection- pg_close_stmt(Pgsql\Connection $connection, string $statement_name): PgSql\Result|false + pg_close_stmt(PgSql\Connection $connection, string $statement_name): PgSql\Result|false
ext-readline
readline_completion_functionReturn type changed:
booltotrue- readline_completion_function(callable $callback): bool + readline_completion_function(callable $callback): true
ext-snmp
snmp_set_oid_numeric_printParameter type changed for parameter #1 (
$format):inttoSnmp\OidOutput|int- snmp_set_oid_numeric_print(int $format): true + snmp_set_oid_numeric_print(Snmp\OidOutput|int $format): truesnmp_set_oid_output_formatParameter type changed for parameter #1 (
$format):inttoSnmp\OidOutput|int- snmp_set_oid_output_format(int $format): true + snmp_set_oid_output_format(Snmp\OidOutput|int $format): true
ext-sockets
socket_cmsg_spaceReturn type changed:
?inttointsocket_cmsg_space( int $level, int $type, int $num = 0 - ): ?int + ): intsocket_addrinfo_lookup- Optional parameter added - #4:
&$error_code = null
socket_addrinfo_lookup( string $host, ?string $service = null, - array $hints = [] + array $hints = [], + &$error_code = null ): array|falseCore
stream_socket_pair- Optional parameter added - #4:
$context = null
stream_socket_pair( int $domain, int $type, - int $protocol + int $protocol, + $context = null ): array|falsetrimParameter default value changed for position #2 (
$characters):" \n\r\t\v\x00"to" \f\n\r\t\v\x00"- trim(string $string, string $characters = " \n\r\t\v\x00"): string + trim(string $string, string $characters = " \f\n\r\t\v\x00"): stringregister_tick_functionReturn type changed:
booltotrue- register_tick_function(callable $callback, mixed ...$args): bool + register_tick_function(callable $callback, mixed ...$args): truestream_select- Optional parameter added - #6:
$context = null
stream_select( ?array &$read, ?array &$write, ?array &$except, ?int $seconds, - ?int $microseconds = null + ?int $microseconds = null, + $context = null ): int|falsestream_is_local- Optional parameter added - #2:
$context = null
- stream_is_local($stream): bool + stream_is_local($stream, $context = null): boolstream_copy_to_stream- Optional parameter added - #5:
$context = null
stream_copy_to_stream( $from, $to, ?int $length = null, - int $offset = 0 + int $offset = 0, + $context = null ): int|falsearray_filterParameter default value changed for position #3 (
$mode):0toARRAY_FILTER_USE_VALUEarray_filter( array $array, ?callable $callback = null, - int $mode = 0 + int $mode = ARRAY_FILTER_USE_VALUE ): arrayrtrimParameter default value changed for position #2 (
$characters):" \n\r\t\v\x00"to" \f\n\r\t\v\x00"- rtrim(string $string, string $characters = " \n\r\t\v\x00"): string + rtrim(string $string, string $characters = " \f\n\r\t\v\x00"): stringchopParameter default value changed for position #2 (
$characters):" \n\r\t\v\x00"to" \f\n\r\t\v\x00"- chop(string $string, string $characters = " \n\r\t\v\x00"): string + chop(string $string, string $characters = " \f\n\r\t\v\x00"): stringheader_register_callbackReturn type changed:
booltotrue- header_register_callback(callable $callback): bool + header_register_callback(callable $callback): trueltrimParameter default value changed for position #2 (
$characters):" \n\r\t\v\x00"to" \f\n\r\t\v\x00"- ltrim(string $string, string $characters = " \n\r\t\v\x00"): string + ltrim(string $string, string $characters = " \f\n\r\t\v\x00"): stringext-zip
zip_entry_closeReturn type changed:
booltotrue#[\Deprecated] - zip_entry_close($zip_entry): bool + zip_entry_close($zip_entry): true
Deprecations
Functions
ext-mbstring
mb_ereg_search_regsFunction deprecated
mb_splitFunction deprecated
mb_regex_set_optionsFunction deprecated
mb_regex_encodingFunction deprecated
mb_eregi_replaceFunction deprecated
mb_eregFunction deprecated
mb_eregiFunction deprecated
mb_ereg_matchFunction deprecated
mb_ereg_replaceFunction deprecated
mb_ereg_replace_callbackFunction deprecated
mb_ereg_searchFunction deprecated
mb_ereg_search_getposFunction deprecated
mb_ereg_search_getregsFunction deprecated
mb_ereg_search_initFunction deprecated
mb_ereg_search_posFunction deprecated
mb_ereg_search_setposFunction deprecated
ext-mysqli
mysqli_get_charsetFunction deprecated
mysqli_stmt_initFunction deprecated
ext-SPL
spl_object_hashFunction deprecated
spl_classesFunction deprecated
Core
strcollFunction deprecated
doublevalFunction deprecated
is_doubleFunction deprecated
is_integerFunction deprecated
is_longFunction deprecated
metaphoneFunction deprecated
Constants
mbstring
MB_ONIGURUMA_VERSIONConstant deprecated
var_dump(MB_ONIGURUMA_VERSION); // 6.9.9Constant MB_ONIGURUMA_VERSION is deprecated since 8.6, because the underlying library is no longer maintained
standard
SORT_LOCALE_STRINGConstant deprecated
var_dump(SORT_LOCALE_STRING); // 5Constant SORT_LOCALE_STRING is deprecated since 8.6, use one of the Collator::*sort*() methods instead
Subscribe to PHP.Watch newsletter for monthly updatesYou will receive an email on last Wednesday of every month and on major PHP releases with new articles related to PHP, upcoming changes, new features and what's changing in the language. No marketing emails, no selling of your contacts, no click-tracking, and one-click instant unsubscribe from any email you receive.
- Optional parameter added - #4:
- Optional parameter added - #4:
- Optional parameter added - #6: