Repository navigation
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Milestone
Description
Pages which need to be added/modified for complete documentation of PHP 8.5:
Note
This issue is still a Work In Progress
Important
Priority should be given to documenting Core language and ext/standard behavioral changes
Migration Guide
Core
Backward Incompatible Changes✅
Details
- It is no longer possible to use "array" and "callable" as class alias names in
class_alias(). Add reserved words restrictions for class-alias in PHP 8.5 #5059 - Loosely comparing uncomparable objects (e.g. enums,
\CurlHandleand other internal classes) to booleans was previously inconsistent. If compared to a boolean literal$object == true, it would behave the same way as(bool) $object. If compared to a statically unknown value$object == $true, it would always returnfalse. This behavior was consolidated to always follow the behavior of(bool) $object. (Document the PHP 8.5 backward incompatible changes #5837) - The return value of
gc_collect_cycles()no longer includes strings and resources that were indirectly collected through cycles. (gc_collect_cycles(): add changelog for PHP 8.5 #5528) - It is now allowed to substitute
staticwithselfor the concrete class name infinalsubclasses. (Document the PHP 8.5 backward incompatible changes #5837) - The tick handlers are now deactivated after all shutdown functions, destructors have run and the output handlers have been cleaned up. This is a consequence of fixing NULL-ptr dereference when using
register_tick_functionin destructor php-src#18033. (Document the PHP 8.5 backward incompatible changes #5837) - Traits are now bound before the parent class. This is a subtle behavioral change, but should more closely match user expectations, demonstrated by Strange behavior of
ReflectionClass::getPropertywith trait and inheritance php-src#15753 and Collision of interface constant and trait constant should not produce fatal error php-src#16198. (Document the PHP 8.5 backward incompatible changes #5837) - Errors emitted during compilation and class linking are now always delayed and handled after compilation or class linking. Fatal errors emitted during compilation or class linking cause any delayed errors to be handled immediately, without calling user-defined error handlers. PR PHP 8.5 migration guide #4906
- Exceptions thrown by user-defined error handlers when handling class linking errors are not promoted to fatal errors anymore and do not prevent linking. PHP 8.5 migration guide #4906
- Applying
#[\Attribute]to an abstract class, enum, interface, or trait triggers an error during compilation. Previously, the attribute could be added, but whenReflectionAttribute::newInstance()was called an error would be thrown. The error can be delayed from compilation to runtime using the new#[\DelayedTargetValidation]attribute. (Document the PHP 8.5 backward incompatible changes #5837 Document DelayedTargetValidation attribute (PHP 8.5) #5457, though without any mention of DelayedTargetValidation) - The
disable_classesINI setting has been removed as it causes various engine assumptions to be broken. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#remove_disable_classes_ini_setting (Document PHP 8.5.0 ini directive deprecations and removals #5419) - Destructing non-array values (other than NULL) using
[]orlist()now emits a warning. RFC: https://wiki.php.net/rfc/warnings-php-8-5#destructuring_non-array_values (Document the PHP 8.5 backward incompatible changes #5837) - A warning is now emitted when casting floats (or strings that look like floats) to int if they cannot be represented as one. This affects explicit int casts and implicit int casts. RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int (Document the PHP 8.5 backward incompatible changes #5837)
- A warning is now emitted when casting NAN to other types. RFC: https://wiki.php.net/rfc/warnings-php-8-5#coercing_nan_to_other_types (Document the PHP 8.5 backward incompatible changes #5837)
Deprecations
-
Returning a non-string from a user output handler is deprecated. The deprecation warning will bypass the handler with the bad return to ensure it is visible; if there are nested output handlers the next one will still be used. RFC: https://wiki.php.net/rfc/deprecations_php_8_4Reverted, Revert "Deprecate returning non-string values from a user output handler (#18932)" php-src#20455 - Trying to produce output (e.g. with
echo) within a user output handler is deprecated. The deprecation warning will bypass the handler producing the output to ensure it is visible; if there are nested output handlers the next one will still be used.If a user output handler returns a non-string and produces output, the warning about producing an output is emitted first.RFC: https://wiki.php.net/rfc/deprecations_php_8_4 (Document the PHP 8.5 core deprecations and max_memory_limit #5823) - Non-canonical cast names
(boolean),(integer),(double), and(binary)have been deprecated, use(bool),(int),(float), and(string)respectively. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_non-standard_cast_names PHP 8.5 deprecated non-canonical cast names #5016 - The
$exclude_disabledparameter of theget_defined_functions()function has been deprecated, as it no longer has any effect since PHP 8.0. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions - Note deprecated get_defined_functions argument. #4893 - Terminating case statements with a semicolon instead of a colon has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_semicolon_after_case_in_switch_statement - Add deprecation/changelog for switch statement semicolons. #4895
- The backtick operator as an alias for
shell_exec()has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_backticks_as_an_alias_for_shell_exec Add changelog entry for deprecation of backtick operator in PHP 8.5.0 #5017 - Returning null from
__debugInfo()has been deprecated. Return an empty array instead. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null (Document the PHP 8.5 core deprecations and max_memory_limit #5823) - The
report_memleaksINI directive has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_report_memleaks_ini_directive (Document PHP 8.5.0 ini directive deprecations and removals #5419) - Constant redeclaration has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_constant_redeclaration (Document the PHP 8.5 core deprecations and max_memory_limit #5823)
- Enacted the follow-up phase of the "Path to Saner Increment/Decrement operators" RFC, meaning that incrementing non-numeric strings is now deprecated. Instead the
str_increment()function should be used. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#enact_follow-up_phase_of_the_path_to_saner_incrementdecrement_operators_rfc (Document the PHP 8.5 core deprecations and max_memory_limit #5823) - The following closure binding issues, which already emit an
E_WARNING, are now deprecated:- Binding an instance to a static closure
- Binding methods to objects that are not instances of the class (or subclass) that the method is defined
- Unbinding
$thisfrom a method - Unbinding
$thisfrom a closure that uses$this - Binding a closure to the scope of an internal class
- Rebinding the scope of a closure created from a function or method
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_closure_binding_issues (Document the PHP 8.5 core deprecations and max_memory_limit #5823)
- Using
nullas an array offset or when callingarray_key_exists()is now deprecated. Instead an empty string should be used. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists (Update array-key-exists.xml with deprecation notice #5063 for array_key_exists) (array offset still needed, update language.types.array.php) (Document the PHP 8.5 null array offset deprecation and final constructor promotion #6033) - Deriving
$_SERVER['argc']and$_SERVER['argv']from the query string for non-CLI SAPIs has been deprecated. Configureregister_argc_argv=0and switch to either$_GETor$_SERVER['QUERY_STRING']to access the information, after verifying that the usage is safe. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_register_argc_argv_ini_directive (Document PHP 8.5.0 ini directive deprecations and removals #5419) - The
__sleep()and__wakeup()magic methods have been deprecated. The__serialize()and__unserialize()magic methods should be used instead, or at the same time if compatibility with PHP 7 is required. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods (Move __sleep()/__wakeup() after __serialize()/unserialize() #5427)
INI changes ✅
Details
- Added
fatal_error_backtracesto control whether fatal errors should include a backtrace. RFC: https://wiki.php.net/rfc/error_backtraces_v2 (ini.fatal-error-backtraces #5452) - Added startup-only
max_memory_limitINI setting to control the maximummemory_limitthat may be configured at startup or runtime. Exceeding this value emits a warning, unless set to-1, and setsmemory_limitto the currentmax_memory_limitinstead. ML discussion: https://externals.io/message/127108 (Document the PHP 8.5 core deprecations and max_memory_limit #5823)
New classes ✅
Details
-
NoDiscardattribute was added. RFC: https://wiki.php.net/rfc/marking_return_value_as_important Add NoDiscard attribute #5041 -
DelayedTargetValidationattribute was added. RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute (Document DelayedTargetValidation attribute (PHP 8.5) #5457)
New functions ✅
Details
-
get_error_handler()allows retrieving the current user-defined error handler function. RFC: https://wiki.php.net/rfc/get-error-exception-handler Document get_error_handler(), get_exception_handler() #4567 -
get_exception_handler()allows retrieving the current user-defined exception handler function. RFC: https://wiki.php.net/rfc/get-error-exception-handler Document get_error_handler(), get_exception_handler() #4567 - Added
Closure::getCurrent()to receive currently executing closure. d74f357
New global constants ✅
Details
-
PHP_BUILD_DATE. Add PHP_BUILD_DATE and PHP_BUILD_PROVIDER constants #5058 -
PHP_BUILD_PROVIDER. Add PHP_BUILD_DATE and PHP_BUILD_PROVIDER constants #5058
New features
-
Closureis now a proper subtype ofcallable(Document the PHP 8.5 core language features #5824) - Added support for
Closuresand first class callables in constant expressions. RFC: https://wiki.php.net/rfc/closures_in_const_expr RFC: https://wiki.php.net/rfc/fcc_in_const_expr (Document the PHP 8.5 core language features #5824) - Fatal Errors (such as an exceeded maximum execution time) now include a backtrace. RFC: https://wiki.php.net/rfc/error_backtraces_v2 (Document the PHP 8.5 core language features #5824)
- Added the
#[\NoDiscard]attribute to indicate that a function's return value is important and should be consumed. RFC: https://wiki.php.net/rfc/marking_return_value_as_important Add NoDiscard attribute #5041 - Added the
(void)cast to indicate that not using a value is intentional. The(void)cast has no effect on the program's execution by itself, but it can be used to suppress warnings emitted by#[\NoDiscard]and possibly also diagnostics emitted by external IDEs or static analysis tools. RFC: https://wiki.php.net/rfc/marking_return_value_as_important (Add (void) casting syntax for PHP 8.5 #5546) - Added asymmetric visibility support for static properties. RFC: https://wiki.php.net/rfc/static-aviz - Document static asymmetric visibility. #4891
- Added support for casts in constant expressions. (Document the PHP 8.5 core language features #5824)
- Added support for attributes on compile-time non-class constants. RFC: https://wiki.php.net/rfc/attributes-on-constants (partially at Document remaining PHP 8.5 changes for attributes, FFI and stream_select #6023)
- The
#[\Deprecated]attribute can now be used on constants. RFC: https://wiki.php.net/rfc/attributes-on-constants (Document clone(), the new #[\Deprecated] targets and hrtime() on macOS #5839) - Added the pipe (
|>) operator. RFC: https://wiki.php.net/rfc/pipe-operator-v3 (Document the pipe operator. #4890) - Constructor property promotion can now be used for final properties. RFC: https://wiki.php.net/rfc/final_promotion (Document the PHP 8.5 null array offset deprecation and final constructor promotion #6033)
-
#[\Override]can now be applied to properties. RFC: https://wiki.php.net/rfc/override_properties Override: document usage with properties (PHP 8.5) #4821 - The
#[\DelayedTargetValidation]attribute can be used to suppress compile-time errors from core (or extension) attributes that are used on invalid targets. These errors are instead reported at runtime if and whenReflectionAttribute::newInstance()is called. RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute (Document DelayedTargetValidation attribute (PHP 8.5) #5457) - The
clonelanguage construct is now a function and supports reassigning (readonly) properties during cloning via the new$withPropertiesparameter. RFC: https://wiki.php.net/rfc/clone_with_v2 (Document clone(), the new #[\Deprecated] targets and hrtime() on macOS #5839)
Other changes ✅
Details
- The high resolution timer (
hrtime()) on macOS now uses the recommendedclock_gettime_nsec_np(CLOCK_UPTIME_RAW)API instead ofmach_absolute_time(). (Document clone(), the new #[\Deprecated] targets and hrtime() on macOS #5839)
New warnings and exceptions
BZ2 ✅
Details
-
bzcompress()now throws aValueErrorwhen$block_sizeis not between 1 and 9. (Document the PHP 8.5 new warnings and exceptions #5838) -
bzcompress()now throws aValueErrorwhen$work_factoris not between 0 and 250. (Document the PHP 8.5 new warnings and exceptions #5838)
FileInfo: ✅
Details
-
finfo_file()andfinfo::file()now throws aValueErrorinstead of aTypeErrorwhen$filenamecontains nul bytes. This aligns the type ofErrorthrown to be consistent with the rest of the language. (Document the PHP 8.5 new warnings and exceptions #5838)
Intl
-
IntlDateFormatter::setTimeZone()/datefmt_set_timezone()throws anIntlExceptionon uninitialised classes/clone failures. (Document remaining PHP 8.5 Intl changes #6021 for the class method) -
Locale::methods throw aValueErrorwhen locale inputs contain null bytes. (ext/intl: document PHP 8.5 changes #5806, Document remaining PHP 8.5 Intl changes #6021)
LDAP: ✅
Details
-
ldap_get_option()andldap_set_option()now throw aValueErrorwhen passing an invalid option. (ext/ldap: document PHP 8.5 changes #5805)
MySQLi: ✅
Details
- Calling the mysqli constructor on an already-constructed object is now no longer possible and throws an
Error. (Document the PHP 8.5 new warnings and exceptions #5838)
PCNTL: ✅
Details
-
pcntl_exec()now throwsValueErrors when entries of the$argsparameter contain null bytes. (Document the PHP 8.5 new warnings and exceptions #5838) -
pcntl_exec()now throwsValueErrors when entries or keys of the$env_varsparameter contain null bytes. (Document the PHP 8.5 new warnings and exceptions #5838)
PDO ✅
Details
- Attempting to call
PDOStatement::setFetchModeduring a call toPDO::fetch(),PDO::fetchObject(),PDO::fetchAll(), for example using tricks such as passing the statement object as a constructor argument when fetching into an object, will now throw anError. (ext/pdo: document the PHP 8.5 fetch mode changes and deprecations #5817) - A
ValueErroris now thrown ifPDO::FETCH_PROPS_LATEis used with a fetch mode different thanPDO::FETCH_CLASS, consistent with other fetch flags. (ext/pdo: document the PHP 8.5 fetch mode changes and deprecations #5817) - A
ValueErroris now thrown ifPDO::FETCH_INTOis used as a fetch mode inPDO::fetchAll(), similar toPDO::FETCH_LAZY. (ext/pdo: document the PHP 8.5 fetch mode changes and deprecations #5817)
PDO_FIREBIRD ✅
Details
- A
ValueErroris now thrown when trying to set a cursor name that is too long on a PDOStatement resulting from the Firebird driver. (ext/pdo: document the PHP 8.5 fetch mode changes and deprecations #5817)
PDO_SQLITE: ✅
Details
- SQLite
PDO::quote()will now throw an exception or emit a warning, depending on the error mode, if the string contains a null byte. (ext/pdo_sqlite: document the PHP 8.5 additions and behaviour changes #5818) -
PDO::sqliteCreateCollationwill now throw an exception if the callback has the wrong return type, making it more in line withPdo_Sqlite::createCollationbehavior. (ext/pdo_sqlite: document the PHP 8.5 additions and behaviour changes #5818)
POSIX ✅
Details
-
posix_isattyraises anE_WARNINGmessage when encountering an invalid file descriptor. POSIX: add changelog entries for PHP 8.5 changes #5534 -
posix_fpathconfchecks invalid file descriptors and sets last_error to EBADF and raises anE_WARNINGmessage. POSIX: add changelog entries for PHP 8.5 changes #5534 -
posix_killthrows aValueErrorwhen the process_id argument is lower or greater than what supports the platform (signed integer or long range),posix_setpgidthrows aValueErrorwhen the process_id or the process_group_id is lower than zero or greater than what supports the platform. POSIX: add changelog entries for PHP 8.5 changes #5534 -
posix_setrlimitthrows aValueErrorwhen the hard_limit of soft_limit argument are lower than -1 or if soft_limit is greater than hard_limit. POSIX: add changelog entries for PHP 8.5 changes #5534
Session ✅
Details
- Attempting to write session data where
$_SESSIONhas a key containing the pipe character will now emit a warning instead of silently failing. (Document the PHP 8.5 new warnings and exceptions #5838) -
session_startis stricter in regard to the option argument. It throws aValueErrorif the whole is not a hashmap or aTypeErrorif read_and_close value is not a valid type compatible with int. (Document the PHP 8.5 new warnings and exceptions #5838)
SimpleXML ✅
Details
- Passing an XPath expression that returns something other than a node set to
SimpleXMLElement::xpath()will now emit a warning and return false, instead of silently failing and returning an empty array. (Document the PHP 8.5 new warnings and exceptions #5838)
SNMP✅
Details
-
snmpget,snmpset,snmp_get2,snmp_set2,snmp_get3,snmp_set3andSNMP::__construct()throw aValueErrorwhen the hostname is too large, contains any null byte or if the port is given when negative or greater than 65535, timeout and retries values are lower than -1 or too large. SNMP: add changelog for PHP 8.5 ValueError validation #5533
Sockets ✅
Details
-
socket_create_listen,socket_bindandsocket_sendtothrow aValueErrorif the port is lower than 0 or greater than 65535, and also if any of the hints array entries are indexed numerically. Sockets: add changelog entries for PHP 8.5 changes #5535 -
socket_addrinfo_lookupthrows aTypeErrorif any of the hints values cannot be cast to int and can throw aValueErrorif any of these values overflow. Sockets: add changelog entries for PHP 8.5 changes #5535 -
socket_set_optionwithMCAST_LEAVE_GROUP/MCAST_LEAVE_SOURCE_GROUPoptions will throw an exception if the value isn't a valid object or array. Sockets: add changelog entries for PHP 8.5 changes #5535 -
socket_set_optionwith multicast context throws aValueErrorwhen the created socket is not ofAF_INET/AF_INET6family. Sockets: add changelog entries for PHP 8.5 changes #5535
Tidy ✅
Details
-
tidy::__construct/parseFile/parseStringnow throws aValueErrorif the configuration contains an invalid or set a read-only internal entry, aTypeErrorcontains, at least, one element when the key is not a string. (Document the PHP 8.5 new warnings and exceptions #5838)
New extensions
Lexbor✅
Details
- An always enabled lexbor extension is added. It contains the lexbor library that was separated from ext/dom for being reused among other extensions. The new extension is not directly exposed to userland. PHP 8.5 migration guide #4906
URI ✅
Details
- An always enabled uri extension is added that can be used for handling URIs and URLs according to RFC 3986 and WHATWG URL. RFC: https://wiki.php.net/rfc/url_parsing_api (PHP 8.5 migration guide #4906)
- New classes (Document ext/uri #5392)
-
Uri\UriException(uri: Add description to all Exceptions #5466) -
Uri\InvalidUriException(uri: Add description to all Exceptions #5466) -
Uri\UriComparisonMode(uri: Add a description forUriComparisonMode#5476) -
Uri\Rfc3986\Uri(Document ext/uri #5392) -
Uri\WhatWg\InvalidUrlException(uri: Add description to all Exceptions #5466) -
Uri\WhatWg\UrlValidationErrorType(uri: Add description toUrlValidationErrorType#5474) -
Uri\WhatWg\UrlValidationError(uri: Improve explanation for UrlValidationError #5472) -
Uri\WhatWg\Url(Document ext/uri #5392)
-
SAPI changes
CLI ✅
Details
- Trying to set a process title that is too long with
cli_set_process_title()will now fail instead of silently truncating the given title. (Document 8.5 CLI SAPI changes #5077) - Added a new
--ini=diffoption to print INI settings changed from the builtin default. (Document 8.5 CLI SAPI changes #5077)
CLI/CGI ✅
Details
- The
-zor--zend-extensionoption has been removed as it was non-functional. Use-d zend_extension=<path>instead. (Document 8.5 CLI SAPI changes #5077)
FPM✅
Details
- FPM with httpd ProxyPass decodes the full script path. Added
fastcgi.script_path_encodedINI setting to prevent this new behavior. ([fpm] Document PHP 8.5 FPM changes: fastcgi.script_path_encoded and access log limit #5855) - FPM access log limit now respects log_limit value. ([fpm] Document PHP 8.5 FPM changes: fastcgi.script_path_encoded and access log limit #5855)
Extension changes
Curl✅
Details
- Deprecations
- The
curl_close()function has been deprecated, asCurlHandleobjects are freed automatically. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_close curl_close: add changelog for NOP and deprecation #5178 - The
curl_share_close()function has been deprecated, asCurlShareHandleobjects are freed automatically. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_share_close curl_share_close: add changelog for NOP and deprecation #5249
- The
- New classes
-
CurlSharePersistentHandlerepresenting a share handle that is persisted across multiple PHP requests. RFC: https://wiki.php.net/rfc/curl_share_persistence_improvementext/curl: addcurl_share_init_persistent#4363
-
- New functions
-
curl_multi_get_handles()allows retrieving allCurlHandles current attached to aCurlMultiHandle. This includes both handles added usingcurl_multi_add_handle()and handles accepted byCURLMOPT_PUSHFUNCTION. ([curl] Document PHP 8.5 curl changes #5850) -
curl_share_init_persistent()allows creating a share handle that is persisted across multiple PHP requests. RFC: https://wiki.php.net/rfc/curl_share_persistence_improvementext/curl: addcurl_share_init_persistent#4363
-
- New global constants
-
CURLINFO_USED_PROXY. (Document new cURL constants (PHP 8.5) #5606) -
CURLINFO_HTTPAUTH_USED. (Document new cURL constants (PHP 8.5) #5606) -
CURLINFO_PROXYAUTH_USED. (Document new cURL constants (PHP 8.5) #5606) -
CURLINFO_CONN_ID. (Document new cURL constants (PHP 8.5) #5606) -
CURLINFO_QUEUE_TIME_T. (Document new cURL constants (PHP 8.5) #5606) -
CURLOPT_INFILESIZE_LARGE. (Document new cURL constants (PHP 8.5) #5606) -
CURLFOLLOW_ALL. (Document new cURL constants (PHP 8.5) #5606) -
CURLFOLLOW_OBEYCODE. (Document new cURL constants (PHP 8.5) #5606) -
CURLFOLLOW_FIRSTONLY. (Document new cURL constants (PHP 8.5) #5606)
-
- Other changes
-
curl_easy_setoptwithCURLOPT_FOLLOWLOCATIONoption's value no longer is treated as boolean but integer to handleCURLFOLLOW_OBEYCODEandCURLFOLLOW_FIRSTONLY. ([curl] Document PHP 8.5 curl changes #5850) - Added support for share handles that are persisted across multiple PHP requests, safely allowing for more effective connection reuse. RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement ([curl] Document PHP 8.5 curl changes #5850 &
ext/curl: addcurl_share_init_persistent#4363) - Added support for
CURLINFO_USED_PROXY(libcurl >= 8.7.0),CURLINFO_HTTPAUTH_USED, andCURLINFO_PROXYAUTH_USED(libcurl >= 8.12.0) to thecurl_getinfo()function. Whencurl_getinfo()returns an array, the same information is available as"used_proxy","httpauth_used", and"proxyauth_used"keys.CURLINFO_USED_PROXYgets zero set if no proxy was used in the previous transfer or a non-zero value if a proxy was used.CURLINFO_HTTPAUTH_USEDandCURLINFO_PROXYAUTH_USEDget bitmasks indicating the HTTP and proxy authentication methods that were used in the previous request. SeeCURLAUTH_*constants for possible values. (Document new cURL constants (PHP 8.5) #5606) - Added
CURLOPT_INFILESIZE_LARGECurl option, which is a safe replacement forCURLOPT_INFILESIZE. On certain systems,CURLOPT_INFILESIZEonly accepts a 32-bit signed integer as the file size (2.0 GiB) even on 64-bit systems.CURLOPT_INFILESIZE_LARGEaccepts the largest integer value the system can handle. (Document new cURL constants (PHP 8.5) #5606) - Added
CURLFOLLOW_OBEYCODE,CURLFOLLOW_FIRSTONLYandCURLFOLLOW_ALLvalues forCURLOPT_FOLLOWLOCATIONcurl_easy_setoptoption.CURLFOLLOW_OBEYCODEto follow more strictly in regard to redirect if they are allowed.CURLFOLLOW_FIRSTONLYto follow only the first redirect thus if there is any follow up redirect, it won't go any further.CURLFOLLOW_ALLis equivalent to settingCURLOPT_FOLLOWLOCATIONto true. (Document new cURL constants (PHP 8.5) #5606, [curl] Document PHP 8.5 curl changes #5850) - Added support for
CURLINFO_CONN_ID(libcurl >= 8.2.0) to thecurl_getinfo()function. This constant allows retrieving the unique ID of the connection used by a cURL transfer. It is primarily useful when connection reuse or connection pooling logic is needed in PHP-level applications. Whencurl_getinfo()returns an array, this value is available as the"conn_id"key. (Document new cURL constants (PHP 8.5) #5606) - Added support for
CURLINFO_QUEUE_TIME_T(libcurl >= 8.6.0) to thecurl_getinfo()function. This constant allows retrieving the time (in microseconds) that the request spent in libcurl’s connection queue before it was sent. This value can also be retrieved by passingCURLINFO_QUEUE_TIME_Tto thecurl_getinfo()$option parameter. (Document new cURL constants (PHP 8.5) #5606) - Added support for
CURLOPT_SSL_SIGNATURE_ALGORITHMSto specify the signature algorithms to use for TLS. ([curl] Document PHP 8.5 curl changes #5850)
-
Date
- Deprecations
- The
DATE_RFC7231andDateTimeInterface::RFC7231constants have been deprecated. This is because the associated timezone is ignored and always uses GMT. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231 (DATE_RFC7231 constant has been deprecated in PHP 8.5 #5505) - The
__wakeup()magic method ofDateTimeInterface,DateTime,DateTimeImmutable,DateTimeZone,DateInterval, andDatePeriodhas been deprecated in favour of the__unserialize()magic method. Related to RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods (Document Dom\Element::getElementsByClassName(), Dom\Element::insertAdjacentHTML() and the Date __wakeup() deprecation #6034)
- The
DOM
- BC breaks
- Cloning a
DOMNamedNodeMap,DOMNodeList,Dom\NamedNodeMap,Dom\NodeList,Dom\HTMLCollection, andDom\DtdNamedNodeMapnow fails. This never actually resulted in a working object, so the impact should actually be zero. (Document DOM node collection cloning failure for PHP 8.5 #5877)
- Cloning a
- New functions
- Added
Dom\Element::getElementsByClassName(). (Document Dom\Element::getElementsByClassName() for PHP 8.5 #5879, Document Dom\Element::getElementsByClassName(), Dom\Element::insertAdjacentHTML() and the Date __wakeup() deprecation #6034) - Added
Dom\Element::insertAdjacentHTML(). (Document remaining PHP 8.5 changes for DOM, POSIX, Reflection, Sockets and SOAP #6022, Document Dom\Element::getElementsByClassName(), Dom\Element::insertAdjacentHTML() and the Date __wakeup() deprecation #6034)
- Added
- Other changes
- Added
Dom\Element::$outerHTML. (Document Dom\Element::$outerHTML property (PHP 8.5) #5676) - Added
$childrenproperty toDom\ParentNodeimplementations. (Document the new Dom\ParentNode $children property (PHP 8.5) #5677)
- Added
Enchant ✅
Details
- New functions
- Added
enchant_dict_remove_from_session()to remove a word added to the spellcheck session viaenchant_dict_add_to_session(). (ext/pgsql, ext/enchant: document the functions added in PHP 8.5 #5820) - Added
enchant_dict_remove()to put a word on the exclusion list and remove it from the session dictionary. (ext/pgsql, ext/enchant: document the functions added in PHP 8.5 #5820)
- Added
Exif
- Other changes
- Add OffsetTime* Exif tags. (Document PHP 8.5 image changes (HEIF, SVG, units, Exif OffsetTime) #5948)
- Added support for HEIF/HEIC. (Partially done for HEIF in PHP 8.5 | Add IMAGETYPE_HEIF constant to the migration guide and image constant pages #5042, Document PHP 8.5 image changes (HEIF, SVG, units, Exif OffsetTime) #5948)
FileInfo✅
Details
- Deprecations
- The
finfo_close()function has been deprecated. Asfinfoobjects are freed automatically. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_finfo_close finfo_close: add changelog for NOP and deprecation #5373 - The $context parameter of the
finfo_buffer()function has been deprecated as it is ignored. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_context_parameter_for_finfo_buffer Add PHP 8.5.0 deprecation changelog entries #5369
- The
- Other changes
- Upgraded file from 5.45 to 5.46. (PHP 8.5 migration guide #4906)
- The return type of
finfo_close()has been changed to true, rather than bool. (Fix return type for 5 misc functions: bool -> true #5357)
Filter ✅
Details
- New classes
-
Filter\FilterException(https://wiki.php.net/rfc/filter_throw_on_failure) (Document FILTER_THROW_ON_FAILURE and the Filter exception classes (PHP 8.5) #5607) -
Filter\FilterFailedException(https://wiki.php.net/rfc/filter_throw_on_failure) (Document FILTER_THROW_ON_FAILURE and the Filter exception classes (PHP 8.5) #5607)
-
- New global constants
GD: ✅
Details
- Deprecations
- The
imagedestroy()function has been deprecated, asGdImageobjects are freed automatically. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy imagedestroy: add changelog for deprecation #5125
- The
Hash✅
Details
- Deprecations
- The
MHASH_*constants have been deprecated. These have been overlooked when themhash*()function family has been deprecated per https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family (mhash: fix the constants page and document the 8.5 deprecation #5875)
- The
Intl
- BC breaks
- The extension now requires at least ICU 57.1. (Document remaining PHP 8.5 Intl changes #6021)
- The behaviour of
Collator::SORT_REGULARwith respect to handling numeric strings is now aligned with the behaviour ofSORT_REGULARin ext/standard. This is a consequence of fixing bug [intl] Weird numeric sort in Collator php-src#18566. (Document remaining PHP 8.5 Intl changes #6021)
- Deprecations
- The
intl.error_levelINI setting has been deprecated. Errors should either be checked manually or exceptions should be enabled by using theintl.use_exceptionsINI setting. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_intlerror_level_ini_setting (Document remaining PHP 8.5 Intl changes #6021)
- The
- New classes
- Added
IntlListFormatterclass to format, order, and punctuate a list of items with a given locale,IntlListFormatter::TYPE_AND,IntlListFormatter::TYPE_OR,IntlListFormatter::TYPE_UNITSoperands andIntlListFormatter::WIDTH_WIDE,IntlListFormatter::WIDTH_SHORTandIntlListFormatter::WIDTH_NARROWwidths. It is supported from icu 67. (Add IntlListFormatter class documentation (PHP 8.5) #5692)
- Added
- New functions
- Added
locale_is_right_to_left/Locale::isRightToLeft, returns true if the locale is written right to left (after its enrichment with likely subtags). (Document Locale::isRightToLeft (PHP 8.5) #5055 forLocale::isRightToLeft, fe74bcd forlocale_is_right_to_left) - Added
grapheme_levenshtein()function. RFC: https://wiki.php.net/rfc/grapheme_levenshtein (Add manual for grapheme_levenshtein function. #5005, Add grapheme_levenshtein function support for PHP 8.5 #5863) - Added
Locale::addLikelySubtagsandLocale::minimizeSubtagsto handle likely tags on a given locale. (ext/intl: document PHP 8.5 changes #5806)
- Added
- New class constants
- Added class constants
NumberFormatter::CURRENCY_ISO,NumberFormatter::CURRENCY_PLURAL,NumberFormatter::CASH_CURRENCY, andNumberFormatter::CURRENCY_STANDARDfor various currency-related number formats. (Add some missing properties and constants #5069)
- Added class constants
- New global constants
-
DECIMAL_COMPACT_SHORT.(Add some missing properties and constants #5069) -
DECIMAL_COMPACT_LONG.(Add some missing properties and constants #5069)
-
- Other changes
-
grapheme_extract()properly assigns $next value when skipping over invalid starting bytes. Previously there were cases where it would point to the start of the grapheme boundary instead of the end. (Document remaining PHP 8.5 Intl changes #6021) -
transliterator_get_error_code(),transliterator_get_error_message()TransLiterator::getErrorCode(), andTransLiterator::getErrorMessage()have dropped the false from the return type union. Returning false was actually never possible. (Document remaining PHP 8.5 Intl changes #6021) -
grapheme_strpos(),grapheme_stripos(),grapheme_strrpos(),grapheme_strripos(),grapheme_strstr(),grapheme_stristr()andgrapheme_levenshtein()functions add $locale parameter. RFC: https://wiki.php.net/rfc/grapheme_add_locale_for_case_insensitive (Sync newly added parameters #5074) - Intl's internal error mechanism has been modernized so that it indicates more accurately which call site caused what error. Moreover, some ext/date exceptions have been wrapped inside a IntlException now. (PHP 8.5 migration guide #4906)
-
LDAP✅
Details
- Deprecations
- Specific Oracle Instant Client calls and constants have been deprecated. List of affected calls:
ldap_connectwith wallet support,ldap_connect_wallet()List of affected constants:GSLC_SSL_NO_UATH,GSLC_SSL_ONEWAY_UATH,GSLC_SSL_TWOWAY_UATH. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_building_ext_ldap_against_oracle_ldap (ext/ldap: document PHP 8.5 changes #5805)
- Specific Oracle Instant Client calls and constants have been deprecated. List of affected calls:
- Other changes
-
ldap_get_option()now accepts a NULL connection, asldap_set_option(), to allow retrieval of global options. (Sync parameter type and name changes #5073)
-
libxml✅
Details
- Other changes
-
libxml_set_external_entity_loader()now has a formal return type of true. (Fix return type for 5 misc functions: bool -> true #5357)
-
MBstring✅
Details
- BC breaks
- Unicode data tables have been updated to Unicode 17.0 (PHP 8.5 migration guide #4906, ext/mbstring: fix the version of the character index change, it shipped in 8.3.2 #5797)
MySQLi ✅
Details
- Deprecations
- The
mysqli_execute()alias function has been deprecated. Usemysqli_stmt_execute()instead. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_mysqli_execute (Add deprecation notice for mysqli_execute that was added in PHP 8.5 #5595)
- The
ODBC✅
Details
- BC breaks
- ODBC now assumes that at least ODBC 3.5 functionality is available. The ODBCVER definition and build system flags to control it have been removed. (PHP 8.5 migration guide #4906)
- ODBC no longer has build flags to build against specific drivers (except for DB2) and removes special cases for those drivers. It is strongly recommended to use a driver manager like iODBC or unixODBC on non-Windows. (PHP 8.5 cleanup for ODBC documentation #4870)
Opcache
- BC breaks
- The Opcache extension is now always built into the PHP binary and is always loaded. The INI directives
opcache.enableandopcache.enable_cliare still honored. The--enable-opcache/--disable-opcacheconfigure flags have been removed, and the build does not produceopcache.soorphp_opcache.dllobjects anymore. Usingzend_extension=opcache.soorzend_extension=php_opcache.dllINI directives will emit a warning. (opcache: document always-built-in and file_cache_read_only (8.5) #5881)
- The Opcache extension is now always built into the PHP binary and is always loaded. The INI directives
- INI changes
- Added
opcache.file_cache_read_onlyto support a read-onlyopcache.file_cachedirectory, for use with read-only file systems (e.g. read-only Docker containers). Best used withopcache.validate_timestamps=0,opcache.enable_file_override=1, andopcache.file_cache_consistency_checks=0. Note: A cache generated with a different build of PHP, a different file path, or different settings (including which extensions are loaded), may be ignored. (opcache: document always-built-in and file_cache_read_only (8.5) #5881) - The default value of
opcache.jit_hot_loopis now 61 (a prime) to prevent it from being a multiple of loop iteration counts. It is recommended that this parameter is set to a prime number. Update opcache.jit_hot_loop #4685 - Changing
opcache.memory_consumptionwhen OPcache SHM is already set up will now correctly report a failure instead of silently doing nothing and showing misleading values in PHPInfo.
- Added
- New functions
- Added
opcache_is_script_cached_in_file_cache(). (Add OPCache file cache and JIT blacklist functions #5050)
- Added
- Other changes
- The Opcache extension is now always built into the PHP binary and is always loaded. The INI directives
opcache.enableandopcache.enable_cliare still honored.
- The Opcache extension is now always built into the PHP binary and is always loaded. The INI directives
OpenSSL
- Deprecations
- The
$key_lengthparameter foropenssl_pkey_derive()has been deprecated. This is because it is either ignored, or truncates the key, which can be a vulnerability. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_key_length_parameter_of_openssl_pkey_derive Document key_length param deprecation in openssl_pkey_derive #5032
- The
- INI changes
- Added
openssl.libctxto select the OpenSSL library context type. Either custom libctx for each thread can be used or a single global (default) libctx is used. Document openssl.libctx INI #5033
- Added
- New global constants
-
OPENSSL_PKCS1_PSS_PADDING(Document new OpenSSL constants (PHP 8.5) #5605) -
PKCS7_NOSMIMECAP(Document new OpenSSL constants (PHP 8.5) #5605) -
PKCS7_CRLFEOL(Document new OpenSSL constants (PHP 8.5) #5605) -
PKCS7_NOCRL(Document new OpenSSL constants (PHP 8.5) #5605) -
PKCS7_NO_DUAL_CONTENT(Document new OpenSSL constants (PHP 8.5) #5605)
-
- Other changes
-
openssl_public_encrypt()andopenssl_private_decrypt()have new parameter$digest_algothat allows specifying hash digest algorithm for OEAP padding. (Sync newly added parameters #5074) -
openssl_sign()andopenssl_verify()have new parameter$paddingto allow using more secure RSA PSS padding. (Sync newly added parameters #5074, Document padding constants for OpenSSL functions. #5758) -
openssl_cms_encrypt()$cipher_algoparameter can be a string with the cipher name. That allows to use more algorithms including AES GCM cipher algorithms for auth enveloped data. (Document the remaining PHP 8.5 PDO constant deprecations, the Sockets ETH_P_* constants and the openssl_cms_encrypt() cipher_algo description #6035, Sync parameter type and name changes #5073)
-
PCNTL✅
Details
- Other changes
-
pcntl_exec()now has a formal return type of false. -
pcntl_waitid()takes an additional resource_usage argument to gather various platform specific metrics about the child process.
-
PCRE✅
Details
- BC breaks
- The extension is compiled without semi-deprecated
PCRE2_EXTRA_ALLOW_LOOKAROUND_BSKcompile option.\Kin lookbehind/lookahead should be always invalid PCRE2Project/pcre2#736 (comment) (PHP 8.5 migration guide #4906)
- The extension is compiled without semi-deprecated
-
Other changes-
Upgraded pcre2lib from 10.44 to 10.46.(reverted, Downgrade pcre2 to 10.44 php-src#20380)
-
PDO
- BC breaks
- The constructor arguments set in conjunction with
PDO::FETCH_CLASSnow follow the usual CUFA (call_user_func_array) semantics. This means string keys will act like a named argument. Moreover, automatic wrapping for by-value arguments passed to a by-ref parameter has been removed, and the usualE_WARNINGabout this is now emitted. To pass a variable by-ref to a constructor argument use the general array value reference assignment:$ctor_args = [&$valByRef](ext/pdo: document the PHP 8.5 fetch mode changes and deprecations #5817) - The value of the constants
PDO::FETCH_GROUP,PDO::FETCH_UNIQUE,PDO::FETCH_CLASSTYPE,PDO::FETCH_PROPS_LATE, andPDO::FETCH_SERIALIZEhave changed. (PHP 8.5 migration guide #4906)
- The constructor arguments set in conjunction with
- Deprecations
- The "uri:" DSN scheme has been deprecated due to security concerns with DSNs coming from remote URIs. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_pdo_s_urischeme (ext/pdo: document the PHP 8.5 fetch mode changes and deprecations #5817)
- Driver specific constants in the PDO class have been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_driver_specific_pdo_constants_and_methods (ext/pdo: document the PHP 8.5 fetch mode changes and deprecations #5817, Document deprecations in PDO constants and methods in PHP 8.5 #5635, pdo_pgsql: document 8.5 deprecations, add examples, fix inconsistencies #5626, Document the remaining PHP 8.5 PDO constant deprecations, the Sockets ETH_P_* constants and the openssl_cms_encrypt() cipher_algo description #6035)
- Driver specific methods in the PDO class have been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_driver_specific_pdo_constants_and_methods (Document deprecations in PDO constants and methods in PHP 8.5 #5635, pdo_pgsql: document 8.5 deprecations, add examples, fix inconsistencies #5626)
List of affected constants that still need documentation of the deprecation as of 2026.09.22
- PDO::DBLIB_ATTR_CONNECTION_TIMEOUT => Pdo\Dblib::ATTR_CONNECTION_TIMEOUT
- PDO::DBLIB_ATTR_QUERY_TIMEOUT => Pdo\Dblib::ATTR_QUERY_TIMEOUT
- PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER => Pdo\Dblib::ATTR_STRINGIFY_UNIQUEIDENTIFIER
- PDO::DBLIB_ATTR_VERSION => Pdo\Dblib::ATTR_VERSION
- PDO::DBLIB_ATTR_TDS_VERSION => Pdo\Dblib::ATTR_TDS_VERSION
- PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS => Pdo\Dblib::ATTR_SKIP_EMPTY_ROWSETS
- PDO::DBLIB_ATTR_DATETIME_CONVERT => Pdo\Dblib::ATTR_DATETIME_CONVERT
- PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES => Pdo\Sqlite::ATTR_EXTENDED_RESULT_CODES
- PDO::SQLITE_ATTR_OPEN_FLAGS => Pdo\Sqlite::OPEN_FLAGS
- PDO::SQLITE_ATTR_READONLY_STATEMENT => Pdo\Sqlite::ATTR_READONLY_STATEMENT
- PDO::SQLITE_OPEN_READONLY => Pdo\Sqlite::OPEN_READONLY
- PDO::SQLITE_OPEN_READWRITE => Pdo\Sqlite::OPEN_READWRITE
- PDO::SQLITE_OPEN_CREATE => Pdo\Sqlite::OPEN_CREATE
List of affected constants and their replacement:
- PDO::DBLIB_ATTR_CONNECTION_TIMEOUT => Pdo\Dblib::ATTR_CONNECTION_TIMEOUT
- PDO::DBLIB_ATTR_QUERY_TIMEOUT => Pdo\Dblib::ATTR_QUERY_TIMEOUT
- PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER => Pdo\Dblib::ATTR_STRINGIFY_UNIQUEIDENTIFIER
- PDO::DBLIB_ATTR_VERSION => Pdo\Dblib::ATTR_VERSION
- PDO::DBLIB_ATTR_TDS_VERSION => Pdo\Dblib::ATTR_TDS_VERSION
- PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS => Pdo\Dblib::ATTR_SKIP_EMPTY_ROWSETS
- PDO::DBLIB_ATTR_DATETIME_CONVERT => Pdo\Dblib::ATTR_DATETIME_CONVERT
- PDO::FB_ATTR_DATE_FORMAT => Pdo\Firebird::ATTR_DATE_FORMAT
- PDO::FB_ATTR_TIME_FORMAT => Pdo\Firebird::ATTR_TIME_FORMAT
- PDO::FB_ATTR_TIMESTAMP_FORMAT => Pdo\Firebird::ATTR_TIMESTAMP_FORMAT
- PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => Pdo\Mysql::ATTR_USE_BUFFERED_QUERY
- PDO::MYSQL_ATTR_LOCAL_INFILE => Pdo\Mysql::ATTR_LOCAL_INFILE
- PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY => Pdo\Mysql::ATTR_LOCAL_INFILE_DIRECTORY
- PDO::MYSQL_ATTR_INIT_COMMAND => Pdo\Mysql::ATTR_INIT_COMMAND
- PDO::MYSQL_ATTR_MAX_BUFFER_SIZE => Pdo\Mysql::ATTR_MAX_BUFFER_SIZE
- PDO::MYSQL_ATTR_READ_DEFAULT_FILE => Pdo\Mysql::ATTR_READ_DEFAULT_FILE
- PDO::MYSQL_ATTR_READ_DEFAULT_GROUP => Pdo\Mysql::ATTR_READ_DEFAULT_GROUP
- PDO::MYSQL_ATTR_COMPRESS => Pdo\Mysql::ATTR_COMPRESS
- PDO::MYSQL_ATTR_DIRECT_QUERY => Pdo\Mysql::ATTR_DIRECT_QUERY
- PDO::MYSQL_ATTR_FOUND_ROWS => Pdo\Mysql::ATTR_FOUND_ROWS
- PDO::MYSQL_ATTR_IGNORE_SPACE => Pdo\Mysql::ATTR_IGNORE_SPACE
- PDO::MYSQL_ATTR_SSL_KEY => Pdo\Mysql::ATTR_SSL_KEY
- PDO::MYSQL_ATTR_SSL_CERT => Pdo\Mysql::ATTR_SSL_CERT
- PDO::MYSQL_ATTR_SSL_CA => Pdo\Mysql::ATTR_SSL_CA
- PDO::MYSQL_ATTR_SSL_CAPATH => Pdo\Mysql::ATTR_SSL_CAPATH
- PDO::MYSQL_ATTR_SSL_CIPHER => Pdo\Mysql::ATTR_SSL_CIPHER
- PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT
- PDO::MYSQL_ATTR_SERVER_PUBLIC_KEY => Pdo\Mysql::ATTR_SERVER_PUBLIC_KEY
- PDO::MYSQL_ATTR_MULTI_STATEMENTS => Pdo\Mysql::ATTR_MULTI_STATEMENTS
- PDO::ODBC_ATTR_USE_CURSOR_LIBRARY => Pdo\Odbc::ATTR_USE_CURSOR_LIBRARY
- PDO::ODBC_ATTR_ASSUME_UTF8 => Pdo\Odbc::ATTR_ASSUME_UTF8
- PDO::ODBC_SQL_USE_IF_NEEDED => Pdo\Odbc::SQL_USE_IF_NEEDED
- PDO::ODBC_SQL_USE_DRIVER => Pdo\Odbc::SQL_USE_DRIVER
- PDO::ODBC_SQL_USE_ODBC => Pdo\Odbc::SQL_USE_ODBC
- PDO::PGSQL_ATTR_DISABLE_PREPARES => Pdo\Pgsql::ATTR_DISABLE_PREPARES
- PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES => Pdo\Sqlite::ATTR_EXTENDED_RESULT_CODES
- PDO::SQLITE_ATTR_OPEN_FLAGS => Pdo\Sqlite::OPEN_FLAGS
- PDO::SQLITE_ATTR_READONLY_STATEMENT => Pdo\Sqlite::ATTR_READONLY_STATEMENT
- PDO::SQLITE_DETERMINISTIC => Pdo\Sqlite::DETERMINISTIC
- PDO::SQLITE_OPEN_READONLY => Pdo\Sqlite::OPEN_READONLY
- PDO::SQLITE_OPEN_READWRITE => Pdo\Sqlite::OPEN_READWRITE
- PDO::SQLITE_OPEN_CREATE => Pdo\Sqlite::OPEN_CREATE
List of affected methods and their replacement:
PDO::pgsqlCopyFromArray()=>Pdo\Pgsql::copyFromArray()PDO::pgsqlCopyFromFile()=>Pdo\Pgsql::copyFromFile()PDO::pgsqlCopyToArray()=>Pdo\Pgsql::copyToArray()PDO::pgsqlCopyToFile()=>Pdo\Pgsql::copyToFile()PDO::pgsqlGetNotify()=>Pdo\Pgsql::getNotify()PDO::pgsqlGetPid()=>Pdo\Pgsql::getPid()PDO::pgsqlLOBCreate()=>Pdo\Pgsql::lobCreate()PDO::pgsqlLOBOpen()=>Pdo\Pgsql::lobOpen()PDO::pgsqlLOBUnlink()=>Pdo\Pgsql::lobUnlink()PDO::sqliteCreateAggregate()=>Pdo\Sqlite::createAggregate()PDO::sqliteCreateCollation()=>Pdo\Sqlite::createCollation()PDO::sqliteCreateFunction()=>Pdo\Sqlite::createFunction()
PDO_ODBC
- Other changes
- The fetch behaviour for larger columns has been changed. Rather than fetching 256 byte blocks, PDO_ODBC will try to fetch a larger block size; currently, this is the page size minus string overhead. Drivers that return
SQL_NO_TOTALinSQLGetDataare also better handled as well. This should improve compatibility and performance. See pdo_odbc: Don't fetch 256 byte blocks for long columns php-src#10809, Drivers can providePDO_ODBCincorrectly converted data for long columns with stateful encodings php-src#10733. (Document the PDO_ODBC fetch behaviour change in PHP 8.5 #5932)
- The fetch behaviour for larger columns has been changed. Rather than fetching 256 byte blocks, PDO_ODBC will try to fetch a larger block size; currently, this is the page size minus string overhead. Drivers that return
PDO_PGSQL✅
Details
- Deprecations
- Constants related to transaction states have been deprecated:
PDO::PGSQL_TRANSACTION_IDLE,PDO::PGSQL_TRANSACTION_ACTIVE,PDO::PGSQL_TRANSACTION_INTRANS,PDO::PGSQL_TRANSACTION_INERROR,PDO::PGSQL_TRANSACTION_UNKNOWN. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#extpdo_deprecations (pdo_pgsql: document 8.5 deprecations, add examples, fix inconsistencies #5626)
- Constants related to transaction states have been deprecated:
- Other changes
-
PDO::pgsqlCopyFromArrayalso supports inputs asIterable. (pdo_pgsql: document 8.5 deprecations, add examples, fix inconsistencies #5626) -
Pdo\Pgsql::setAttributeandPdo\Pgsql::preparesupportsPDO::ATTR_PREFETCHsets to0which set to lazy fetch mode. In this mode, statements cannot be run in parallel. (pdo_pgsql: document ATTR_PREFETCH lazy fetch, fix copyFromArray sig #5629)
-
PDO_SQLite✅
Details
- New functions
- Added support for
Pdo\Sqlite::setAuthorizer(), which is the equivalent ofSQLite3::setAuthorizer(). The only interface difference is that the pdo version returns void. (ext/pdo_sqlite: document the PHP 8.5 additions and behaviour changes #5818)
- Added support for
- New class constants
- Added class constant
Pdo_Sqlite::ATTR_BUSY_STATEMENT. (ext/pdo_sqlite: document the PHP 8.5 additions and behaviour changes #5818) - Added class constants
Pdo_Sqlite::ATTR_EXPLAIN_STATEMENT,Pdo_Sqlite::EXPLAIN_MODE_PREPARED,Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN,Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN. (ext/pdo_sqlite: document the PHP 8.5 additions and behaviour changes #5818)
- Added class constant
- Other changes
- Increased minimum release version support from 3.7.7 to 3.7.17. (ext/pdo_sqlite: document the PHP 8.5 additions and behaviour changes #5818)
- Added
PDO\Sqlite::ATTR_TRANSACTION_MODEconnection attribute with possible valuesPDO\Sqlite::TRANSACTION_MODE_DEFERRED,PDO\Sqlite::TRANSACTION_MODE_IMMEDIATE, andPDO\Sqlite::TRANSACTION_MODE_EXCLUSIVE, allowing to configure the transaction mode to use when callingbeginTransaction(). (ext/pdo_sqlite: document the PHP 8.5 additions and behaviour changes #5818)
PGSQL✅
Details
- New functions
-
pg_close_stmtoffers an alternative way to close a prepared statement from the DEALLOCATE sql command in that we can reuse its name afterwards. (ext/pgsql, ext/enchant: document the functions added in PHP 8.5 #5820) -
pg_servicereturns the ongoing service name of the connection. (ext/pgsql, ext/enchant: document the functions added in PHP 8.5 #5820)
-
- Other changes
-
pg_copy_fromalso supports inputs asIterable. (Sync parameter type and name changes #5073) -
pg_connectchecks if the connection_string argument contains any null byte. (ext/pgsql, ext/enchant: document the functions added in PHP 8.5 #5820) -
pg_close_stmtchecks if the statement_name argument contains any null byte. (ext/pgsql, ext/enchant: document the functions added in PHP 8.5 #5820)
-
POSIX✅
Details
- New global constants
- Other changes
-
posix_ttynamesets last_error to EBADF when encountering an invalid file descriptor. (POSIX: add changelog entries for PHP 8.5 changes #5534)
-
Readline✅
Details
- Other changes (PHP 8.5 changelog entries for readline functions #5594)
- The return types of
readline_add_history(),readline_clear_history(), andreadline_callback_handler_install()have been changed totrue, rather thanbool.
- The return types of
Reflection
- Deprecations
- The
setAccessible()methods of various Reflection objects have been deprecated, as those no longer have an effect. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible Add PHP 8.5.0 deprecation changelog entries #5369 - Calling
ReflectionClass::getConstant()for constants that do not exist has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionclassgetconstant_for_missing_constants Add PHP 8.5.0 deprecation changelog entries #5369 - Calling
ReflectionProperty::getDefaultValue()for properties without default values has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionpropertygetdefaultvalue_for_properties_without_default_values Add PHP 8.5.0 deprecation changelog entries #5369
- The
- New functions
-
ReflectionConstant::getFileName()was introduced. W.I.P: PHP 8.4: Add ReflectionConstant stubs #4040 -
ReflectionConstant::getExtension()andReflectionConstant::getExtensionName()were introduced. W.I.P: PHP 8.4: Add ReflectionConstant stubs #4040 -
ReflectionConstant::getAttributes()was introduced. RFC: https://wiki.php.net/rfc/attributes-on-constants (Document ReflectionConstant::getAttributes() (PHP 8.5) #5675) -
ReflectionProperty::getMangledName()was introduced. (Document ReflectionProperty::getMangledName() (PHP 8.5) #5693)
-
- Other changes
- The output of
ReflectionClass::__toString()for enums has changed to better indicate that the class is an enum, and that the enum cases are enum cases rather than normal class constants. (Document PHP 8.5 Reflection __toString() output changes #5973) - The output of
ReflectionProperty::__toString()for properties with hooks has changed to indicate what hooks the property has, whether those hooks are final, and whether the property is virtual. This also affects the output ofReflectionClass::__toString()when a class contains hooked properties. (Document PHP 8.5 Reflection __toString() output changes #5973) -
ReflectionAttribute::newInstance()can now throw errors for internal attributes if the attribute was applied on an invalid target and the error was delayed from compile-time to runtime via the#[\DelayedTargetValidation]attribute. RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute (Document remaining PHP 8.5 changes for DOM, POSIX, Reflection, Sockets and SOAP #6022) -
ReflectionConstantis no longer final. Synchronize final class changes #5068
- The output of
Session ✅
Details
- Other changes
-
session_set_cookie_params(),session_get_cookie_params(), andsession_start()now support partitioned cookies via the "partitioned" key. RFC: https://wiki.php.net/rfc/CHIPS (Add partitioned for setcookie and setrawcookie #5051)
-
SOAP✅
Details
- Other changes
- Enumeration cases are now dumped in
__getTypes(). (Document remaining PHP 8.5 changes for DOM, POSIX, Reflection, Sockets and SOAP #6022) - Implemented request #61105: support for Soap 1.2 Reason Text xml:lang attribute. The signature of
SoapFault::__construct()andSoapServer::fault()therefore now have an optional $lang parameter. This support solves compatibility with .NET SOAP clients. (ext/pdo_sqlite: document the PHP 8.5 additions and behaviour changes #5818, Sync newly added parameters #5074)
- Enumeration cases are now dumped in
Sockets
- New global constants
-
IPPROTO_ICMP/IPPROTO_ICMPV6. (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
TCP_FUNCTION_BLK(FreeBSD only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
TCP_FUNCTION_ALIAS(FreeBSD only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
TCP_REUSPORT_LB_NUMA(FreeBSD only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
TCP_REUSPORT_LB_NUMA_NODOM(FreeBSD only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
TCP_REUSPORT_LB_NUMA_CURDOM(FreeBSD only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
TCP_BBR_ALGORITHM(FreeBSD only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
AF_PACKET(Linux only). (Sockets: add changelog entries for PHP 8.5 changes #5535) -
IP_BINDANY(FreeBSD/NetBSD/OpenBSD only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
SO_BUSY_POLL(Linux only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
UDP_SEGMENT(Linux only). (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
SHUT_RD. (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
SHUT_WR. (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
SHUT_RDWR. (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819) -
ETH_P_IP/ETH_P_IPV6/ETH_P_LOOP/ETH_P_ALL(Linux only). (Document the remaining PHP 8.5 PDO constant deprecations, the Sockets ETH_P_* constants and the openssl_cms_encrypt() cipher_algo description #6035)
-
- Other changes
-
socket_create/socket_bindcan createAF_PACKETfamily sockets. (Sockets: add changelog entries for PHP 8.5 changes #5535 partially updatedsocket_create, not done yet, Document remaining PHP 8.5 changes for DOM, POSIX, Reflection, Sockets and SOAP #6022 forsocket_bind) -
socket_getsocknamegets the interface index and its string representation withAF_PACKETsocket. (Sockets: add changelog entries for PHP 8.5 changes #5535)
-
SPL✅
Details
- BC breaks
-
ArrayObjectno longer accepts enums, as modifying the$nameor$valueproperties can break engine assumptions. (Document the PHP 8.5 backward incompatible changes #5837) -
SplFileObject::fwrite's parameter$lengthis now nullable. The default value changed from0tonull. (Sync parameter type and name changes #5073 documented nullable but not default change)
-
- Deprecations
- Unregistering all autoloaders by passing the
spl_autoload_call()function as a callback argument tospl_autoload_unregister()has been deprecated. Instead if this is needed, one should iterate over the return value ofspl_autoload_functions()and callspl_autoload_unregister()on each value. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_spl_autoload_call_to_spl_autoload_unregister Add PHP 8.5.0 deprecation changelog entries #5369 - The
SplObjectStorage::contains(),SplObjectStorage::attach(), andSplObjectStorage::detach()methods have been deprecated in favour ofSplObjectStorage::offsetExists(),SplObjectStorage::offsetSet(), andSplObjectStorage::offsetUnset()respectively. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach Add PHP 8.5.0 deprecation changelog entries #5369 - Using
ArrayObjectandArrayIteratorwith objects has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects (Document the PHP 8.5 backward incompatible changes #5837)
- Unregistering all autoloaders by passing the
Sqlite ✅
Details
- New functions
-
Sqlite3Stmt::busyto check if a statement had been fetched but not completely. (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819)
-
- New class constants
- Added class constants
Sqlite3Stmt::EXPLAIN_MODE_PREPARED,Sqlite3Stmt::EXPLAIN_MODE_EXPLAINandSqlite3Stmt::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN. (ext/sqlite3, ext/sockets: document the PHP 8.5 additions #5819)
- Added class constants
Standard
- BC breaks
- Using a printf-family function with a formatter that did not specify the precision previously incorrectly reset the precision instead of treating it as a precision of 0. See printf: empty precision is interpreted as precision 6, not as precision 0 php-src#18897. (Document printf precision fix in PHP 8.5 #5868)
- Deprecations
- The
socket_set_timeout()alias function has been deprecated. Usestream_set_timeout()instead. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_socket_set_timeout (Document socket_set_timeout() deprecation in PHP 8.5 #5669) - Passing
nullto toreaddir(),rewinddir(), andclosedir()to use the last opened directory has been deprecated. Provide the last opened directory explicitly instead. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_null_to_readdir_rewinddir_and_closedir (Rework documentation for dir functions #4989) - Passing integers outside the interval [0, 255] to
chr()is now deprecated. This is because a byte can only hold a value within this interval. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr Add PHP 8.5.0 deprecation changelog entries #5369 - Passing a string which is not a single byte to
ord()is now deprecated, this is indicative of a bug. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_string_which_are_not_one_byte_long_to_ord Add PHP 8.5.0 deprecation changelog entries #5369 - Relying locally predefined variable
$http_response_headeris deprecated. Instead one should call thehttp_get_last_response_headers()function. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable Mark $http_response_header as deprecated #4977
- The
- New functions
- Added
array_first()andarray_last(). RFC: https://wiki.php.net/rfc/array_first_last [PHP 8.5] added array_[first|last] Documentation #4925
- Added
- New global constants
-
IMAGETYPE_SVGwhen libxml is loaded. (Document PHP 8.5 image changes (HEIF, SVG, units, Exif OffsetTime) #5948)
-
- Other changes
-
mail()now returns the actual sendmail error and detects if the sendmail process was terminated unexpectedly. In such cases, a warning is emitted and the function returns false. Previously, these errors were silently ignored. This change affects only the sendmail transport. (mail: document sendmail error reporting (8.5) #5885) -
getimagesize()now supports HEIF/HEIC images. (Document PHP 8.5 image changes (HEIF, SVG, units, Exif OffsetTime) #5948) -
getimagesize()now supports SVG images when ext-libxml is also loaded. Similarly,image_type_to_extension()andimage_type_to_mime_type()now also handleIMAGETYPE_SVG. (Document PHP 8.5 image changes (HEIF, SVG, units, Exif OffsetTime) #5948) - The array returned by
getimagesize()now has two additional entries: "width_unit" and "height_unit" to indicate in which units the dimensions are expressed. These units are px by default. They are not necessarily the same (just to give one example: one may be cm and the other may be px). (Document PHP 8.5 image changes (HEIF, SVG, units, Exif OffsetTime) #5948) -
setcookie()andsetrawcookie()now support the "partitioned" key. RFC: https://wiki.php.net/rfc/CHIPS (Add partitioned for setcookie and setrawcookie #5051)
-
Tokenizer✅
Details
- New global constants
XML✅
Details
- Deprecations
- The
xml_parser_free()function has been deprecated, asXMLParserobjects are freed automatically. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_xml_parser_free - Mark xml_parser_free as deprecated. #4892
- The
XSL✅
Details
- Other changes
- The
$namespaceargument ofXSLTProcessor::getParameter(),XSLTProcessor::setParameter()andXSLTProcessor::removeParameter()now actually works instead of being treated as empty. This only works if the $name argument does not use Clark notation and is not a QName because in those cases the namespace is taken from the namespace href or prefix respectively. (Document the XSLTProcessor namespace argument in PHP 8.5 #5903)
- The
Zlib
- Other changes
- The "use_include_path" argument for the
gzfile,gzopenandreadgzfilefunctions had been changed frominttoboolean. (Sync parameter type and name changes #5073, PHP 8.5 migration guide #4906) -
gzfile,gzopenandreadgzfilefunctions now respect the default stream context. (Document PHP 8.5 zlib default stream context and flock support #5971) -
flock()is now supported on zlib streams. Previously, this always failed to perform any locking action. (Document PHP 8.5 zlib default stream context and flock support #5971)
- The "use_include_path" argument for the
Windows Support
- The configuration variables
PHP_VERSION,PHP_MINOR_VERSION, andPHP_RELEASE_VERSIONare now always numbers. Previously, they have been strings for buildconf builds. (PHP 8.5 migration guide #4906) -
phpizebuilds now reflect the source tree in the build dir (like that already worked for in-tree builds); some extension builds (especially when using Makefile.frag.w32) may need adjustments. (PHP 8.5 migration guide #4906, Document that com_dotnet is built shared by default as of PHP 8.5 #5924) -
--enable-sanitizeris now supported for MSVC builds. This enables ASan and debug assertions, and is supported as of MSVC 16.10 and Windows 10. (PHP 8.5 migration guide #4906) - The
--with-uncritical-warn-chokeconfiguration option for clang builds is no longer supported. Select warnings to suppress viaCFLAGSinstead. (PHP 8.5 migration guide #4906) - COM:
- The extension is now build shared by default; previously it defaulted to a static extension, although the official Windows binaries built a shared extension. (PHP 8.5 migration guide #4906, Document that com_dotnet is built shared by default as of PHP 8.5 #5924)
- FFI:
- It is no longer necessary to specify the library when using
FFI::cdef()andFFI::load(). However, this convenience feature should not be used in production. (Document remaining PHP 8.5 changes for attributes, FFI and stream_select #6023)
- It is no longer necessary to specify the library when using
- Streams:
- If only pipe streams are contained in the
$readarray, and the$writeand$exceptarrays are empty,stream_select()now behaves similar to POSIX systems, i.e. the function only returns if at least one pipe is ready to be read, or after the timeout expires. Previously,stream_select()returned immediately, reporting all streams as ready to read. (Document remaining PHP 8.5 changes for attributes, FFI and stream_select #6023)
- If only pipe streams are contained in the
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Activity
DanielEScherzer commentedon Sep 26, 2025
I've generated an initial list of things to document based on the UPGRADING from 8.5.0RC1, excluding the performance improvements section
Fan2Shrek commentedon Sep 26, 2025
get_*_handlerfunctions were documented in #4567.Crell commentedon Oct 2, 2025
Issue filed for the pipe operator: #4890
mumumu commentedon Oct 12, 2025
8.5 migration guide PR, ready for review. #4906
vadimonus commentedon Jan 8, 2026
@DanielEScherzer , @Crell
Please take a look at #5083 , it is relevant to pipe operator too
tonurics commentedon Mar 11, 2026
Notes on undocumented features:
\Pdo\Sqlite::ATTR_READONLY_STATEMENTis used with thegetAttribute()method of a \PDOStatement to return a boolean indicating if the statement will attempt a database write.It is not possible to use
\Pdo\Sqlite::ATTR_READONLY_STATEMENTwith thesetAttribute()method.Reference: php/php-src@6f9ebe6
Examples:
TRUE
FALSE
rbowen commentedon Aug 8, 2026
Docs contribution onboarding could use some love. It points to the phpdoc@ mailing list which appears to have been largely abandoned as a place to discuss docs. The IRC channel is lonely, and the discord invite link has expired. (I did docs stuff in ancient times, and have been inspired to start helping out again, but can't find where the discussion happens ... unless this is it here?) I'm happy to make these updates but I'm not sure where to find current info.
Sorry if I'm putting this note the wrong place, but it seemed like the right place.
jordikroon commentedon Aug 20, 2026
@rbowen Thank you for pointing this out. It is actually on my list to improve, together with some other changes to make building the documentation easier across translations.
Just one thing to confirm. Are you referring to the Discord link at https://phpc.chat? As that seems to be working fine, at least on my end.
rbowen commentedon Aug 20, 2026
I'll have to check again. I met some old php friends at fossy and was going through the docs onboarding. I'll have to post a more useful/specific report with links. I'll get that done tomorrow.