PHP 8.6 Codex Changelog
| Newly added | Improvements | Changed | Deprecations | Removals | |
|---|---|---|---|---|---|
| INI Directives | 1 | ‧ | 39 | ‧ | ‧ |
| Constants | 47 | ‧ | 11 | 2 | ‧ |
| Classes | 24 | ‧ | 1 | ‧ | 2 |
| Extensions | ‧ | ‧ | ‧ | ‧ | 2 |
| Functions | 17 | 27 | ‧ | 26 | 15 |
| Enums | 15 | ‧ | ‧ | ‧ | ‧ |
| Interfaces | 1 | ‧ | ‧ | ‧ | ‧ |
Changed
INI Directives
Global
mail.add_x_headerINI directive default value set to
0opcache.jitINI directive default value changed from
1235todisableopcache.enable_cliINI directive default value changed from
0to1mysqlnd.collect_memory_statisticsINI directive default value set to
0mysqli.default_userINI directive default value set to ``
mysqli.default_socketINI directive default value changed from
/var/run/mysqld/mysqld.sockto ``mysqli.default_pwINI directive default value set to ``
mysqli.default_hostINI directive default value set to ``
memory_limitINI directive default value changed from
-1to128Mmail.mixed_lf_and_crlfINI directive default value set to
0opcache.jit_buffer_sizeINI directive default value changed from
256Mto64Mlog_errorsINI directive default value changed from
1to0include_pathINI directive default value changed from
.:/usr/share/phpto.:ignore_repeated_sourceINI directive default value set to
0ignore_repeated_errorsINI directive default value set to
0enable_dlINI directive default value set to
1session.use_strict_modeINI directive default value changed from
0to1zlib.output_compressionINI directive default value set to
0zend.exception_string_param_max_lenINI directive default value changed from
0to15zend.exception_ignore_argsINI directive default value changed from
1to0zend.assertionsINI directive default value changed from
-1to1variables_orderINI directive default value changed from
GPCStoEGPCSuser_dirINI directive default value set to ``
unserialize_callback_funcINI directive default value set to ``
tidy.clean_outputINI directive default value set to
0short_open_tagINI directive default value set to
1allow_url_includeINI directive default value set to
0session.save_pathINI directive default value changed from
/var/lib/php/sessionsto""session.gc_probabilityINI directive default value changed from
0to1session.gc_divisorINI directive default value changed from
1000to100session.cookie_samesiteINI directive default value set to
Laxsession.cookie_httponlyINI directive default value set to
1request_orderINI directive default value changed from
GPto ``pgsql.auto_reset_persistentINI directive default value set to
0pdo_mysql.default_socketINI directive default value changed from
/var/run/mysqld/mysqld.sockto/tmp/mysql.sockauto_append_fileINI directive default value set to ``
auto_prepend_fileINI directive default value set to ``
display_startup_errorsINI directive default value set to
1display_errorsINI directive default value set to
1
Constants
curl
CURLAUTH_ANYConstant value changed from
-17to4294967023CURLAUTH_ANYSAFEConstant value changed from
-18to4294967022CURLVERSION_NOWConstant value changed from
10to11CURLSSH_AUTH_DEFAULTConstant value changed from
-1to4294967295CURLSSH_AUTH_ANYConstant value changed from
-1to4294967295CURLPROTO_ALLConstant value changed from
-1to4294967295
gd
GD_MINOR_VERSIONConstant value changed from
3to4GD_VERSIONConstant value changed from
2.3.3to2.4.0GD_RELEASE_VERSIONConstant value changed from
3to0
pcre
PCRE_VERSIONConstant value changed from
10.42 2022-12-11to10.44 2024-06-07PCRE_VERSION_MINORConstant value changed from
47to44
Classes
ext-soap
SoapClientCloning class objects is no longer allowed
Removals
Extensions
Global
ext-xmlrpcExtension removed
ext-PDO_FirebirdExtension removed
Classes
ext-PDO_Firebird
Pdo\FirebirdClass removed
ext-xmlrpc
XmlRpcServerClass removed
Functions
Core
chrootFunction removed
ext-xmlrpc
xmlrpc_encodeFunction removed
xmlrpc_set_typeFunction removed
xmlrpc_server_register_methodFunction removed
xmlrpc_server_register_introspection_callbackFunction removed
xmlrpc_server_destroyFunction removed
xmlrpc_server_createFunction removed
xmlrpc_server_call_methodFunction removed
xmlrpc_server_add_introspection_dataFunction removed
xmlrpc_parse_method_descriptionsFunction removed
xmlrpc_is_faultFunction removed
xmlrpc_get_typeFunction removed
xmlrpc_encode_requestFunction removed
xmlrpc_decodeFunction removed
xmlrpc_decode_requestFunction removed
Newly added
INI Directives
Global
error_include_argsINI directive added
Constants
Core
PHP_BUILD_PROVIDERConstant added
curl
CURLINFO_POSTTRANSFER_TIME_TConstant added
CURL_SEEKFUNC_CANTSEEKConstant added
CURL_SEEKFUNC_FAILConstant added
CURL_SEEKFUNC_OKConstant added
CURLFOLLOW_ALLConstant added
CURLFOLLOW_FIRSTONLYConstant added
CURLINFO_SIZE_DELIVEREDConstant added
CURLFOLLOW_OBEYCODEConstant added
CURLINFO_HTTPAUTH_USEDConstant added
CURL_READFUNC_ABORTConstant added
CURLOPT_SEEKFUNCTIONConstant added
CURLINFO_QUEUE_TIME_TConstant added
CURLOPT_TCP_KEEPCNTConstant added
CURLINFO_PROXYAUTH_USEDConstant added
CURLINFO_USED_PROXYConstant added
CURLOPT_SSL_SIGNATURE_ALGORITHMSConstant 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_TUPLES_CHUNKConstant added
PGSQL_CONNECTION_SSL_STARTUPConstant added
sockets
EAI_CANCELEDConstant added
AF_UNSPECConstant added
EAI_SOCKTYPEConstant added
EAI_FAILConstant added
EAI_FAMILYConstant added
EAI_IDN_ENCODEConstant added
EAI_INPROGRESSConstant added
EAI_INTRConstant added
EAI_NODATAConstant added
EAI_NONAMEConstant added
EAI_NOTCANCELEDConstant added
EAI_OVERFLOWConstant added
EAI_SERVICEConstant added
TCP_USER_TIMEOUTConstant added
EAI_SYSTEMConstant added
EAI_BADFLAGSConstant added
EAI_ALLDONEConstant added
EAI_AGAINConstant added
EAI_ADDRFAMILYConstant added
SO_DETACH_REUSEPORT_BPFConstant added
standard
ARRAY_FILTER_USE_VALUEConstant added
STREAM_CRYPTO_STATUS_NONEConstant 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\SessionClass added
Openssl\OpensslExceptionException class added
Openssl\PskClass added
Core
Io\Poll\ContextClass added
Io\Poll\BackendUnavailableExceptionException class added
Io\IoExceptionException class added
StreamErrorClass added
StreamExceptionException class added
StreamPollHandleClass added
Io\Poll\FailedHandleAddExceptionException class added
Io\Poll\WatcherClass added
Io\Poll\PollExceptionException class added
Io\Poll\InactiveWatcherExceptionException class added
Io\Poll\HandleAlreadyWatchedExceptionException class added
Io\Poll\InvalidHandleExceptionException class added
Io\Poll\FailedWatcherModificationExceptionException class added
Io\Poll\FailedPollWaitExceptionException class added
Io\Poll\FailedContextInitializationExceptionException class added
Io\Poll\FailedPollOperationExceptionException class added
ext-uri
Uri\WhatWg\UrlBuilderClass added
Uri\Rfc3986\UriBuilderClass added
Functions
ext-gmp
gmp_prevprimeFunction added
gmp_powm_secFunction added
ext-intl
locale_get_display_keyword_valueFunction added
locale_get_display_keywordFunction added
grapheme_strrevFunction added
ext-mysqli
mysqli_quote_stringFunction added
ext-pgsql
pg_close_stmtFunction added
pg_set_chunked_rows_sizeFunction added
ext-snmp
snmp_set_mib_optionFunction added
snmp_set_string_output_formatFunction added
snmp_set_output_optionFunction added
snmp_init_mibFunction added
Core
clampFunction added
stream_socket_get_crypto_statusFunction added
stream_last_errorsFunction added
stream_clear_errorsFunction added
ext-uri
uri\whatwg\url_percent_encodeFunction added
Enums
ext-snmp
Snmp\OutputEnum added
Snmp\StringOutputEnum added
Snmp\OidOutputEnum added
Snmp\MibEnum added
Core
StreamErrorModeEnum added
Io\Poll\EventEnum added
Io\Poll\BackendEnum added
StreamErrorCodeEnum added
StreamErrorStoreEnum added
SortDirectionEnum added
SortDirectionEnum added
ext-uri
Uri\WhatWg\UrlHostTypeEnum added
Uri\Rfc3986\UriTypeEnum added
Uri\Rfc3986\UriHostTypeEnum added
Uri\WhatWg\UrlPercentEncodingModeEnum added
Interfaces
Core
Io\Poll\HandleInterface added
Improvements
Functions
ext-filter
filter_var_arrayReturn type changed:
array|false|nulltoarray|falsefilter_var_array( array $array, array|int $options = FILTER_DEFAULT, bool $add_empty = true - ): array|false|null + ): array|false
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_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_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_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|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|falseext-pcntl
pcntl_signal- Parameter type changed for parameter #3 (
$restart_syscalls):boolto?bool - Parameter default value changed for position #3 (
$restart_syscalls):truetonull
pcntl_signal( int $signal, $handler, - bool $restart_syscalls = true + ?bool $restart_syscalls = null ): boolext-readline
readline_completion_functionReturn type changed:
booltotrue- readline_completion_function(callable $callback): bool + readline_completion_function(callable $callback): true
ext-snmp
snmp_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): truesnmp_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): true
ext-sockets
socket_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|falsesocket_cmsg_spaceReturn type changed:
?inttointsocket_cmsg_space( int $level, int $type, int $num = 0 - ): ?int + ): intCore
register_tick_functionReturn type changed:
booltotrue- register_tick_function(callable $callback, mixed ...$args): bool + register_tick_function(callable $callback, mixed ...$args): truertrimParameter 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"): stringheader_register_callbackReturn type changed:
booltotrue- header_register_callback(callable $callback): bool + header_register_callback(callable $callback): truetrimParameter 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"): stringarray_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 ): arraystream_socket_pair- Optional parameter added - #4:
$context = null
stream_socket_pair( int $domain, int $type, - int $protocol + int $protocol, + $context = null ): array|falseltrimParameter 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"): stringstream_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): boolchopParameter 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"): stringstream_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|falseext-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_searchFunction deprecated
mb_ereg_replace_callbackFunction deprecated
mb_ereg_search_setposFunction deprecated
mb_ereg_replaceFunction deprecated
mb_eregFunction deprecated
mb_ereg_matchFunction deprecated
mb_ereg_search_getposFunction deprecated
mb_ereg_search_getregsFunction deprecated
mb_ereg_search_initFunction deprecated
mb_ereg_search_posFunction deprecated
mb_ereg_search_regsFunction deprecated
mb_eregiFunction deprecated
mb_eregi_replaceFunction deprecated
mb_splitFunction deprecated
mb_regex_set_optionsFunction deprecated
mb_regex_encodingFunction deprecated
ext-mysqli
mysqli_stmt_initFunction deprecated
mysqli_get_charsetFunction deprecated
ext-SPL
spl_classesFunction deprecated
spl_object_hashFunction deprecated
Core
doublevalFunction deprecated
metaphoneFunction deprecated
strcollFunction deprecated
is_longFunction deprecated
is_integerFunction deprecated
is_doubleFunction 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:
- Parameter type changed for parameter #3 (
- Optional parameter added - #6: