Refined developer experience with new utility functions, enhanced debugging, and modern syntax improvements
Major improvements with modern syntax, better APIs, and enhanced developer experience
New URI extension providing standards-compliant URL parsing with modern object-oriented API
Modify properties while cloning, perfect for readonly properties and immutable objects
Chain function calls naturally with the new pipe operator for cleaner, more readable code
Mark functions whose return values should not be ignored
Use closures and first-class callables directly in attributes and constant expressions
Simplified API for persistent cURL share handles with automatic management
Convenient functions to retrieve the first and last elements of arrays
More improvements for better developer experience
Property promotion is now available for final
class constructors, making it easier to create immutable data classes.
Constants now support attributes, allowing for better metadata and documentation directly in code.
The #[\Override]
attribute now works on properties, providing better validation when overriding parent properties.
The #[\Deprecated]
attribute is now available for traits, helping developers mark legacy code.
Static properties now support asymmetric visibility modifiers, allowing fine-grained control over read/write access.
New #[\DelayedTargetValidation]
attribute for improved attribute validation control.
New get_error_handler()
, get_exception_handler()
functions and Closure::getCurrent
method for inspecting registered handlers.
New Dom\Element::getElementsByClassName()
and Dom\Element::insertAdjacentHTML()
methods for better DOM manipulation.
New enchant_dict_remove_from_session()
and enchant_dict_remove()
functions for spell-checking functionality.
New grapheme_levenshtein()
function for calculating edit distance between strings using grapheme clusters.
New opcache_is_script_cached_in_file_cache()
function to check if a script is cached in the file-based OPcache.
New methods: ReflectionConstant::getFileName()
, getExtension()
, getExtensionName()
, getAttributes()
, and ReflectionProperty::getMangledName()
.
New CurlSharePersistentHandle
class and curl_multi_get_handles()
function for improved cURL handling.
Important changes to be aware of when upgrading
PHP 8.5 focuses on new features with minimal breaking changes. Review your application for any deprecated features from previous versions that may be removed in future releases.
PHP 8.5 development and support schedule
PHP 8.5.0 released with all new features and improvements.
Bug fixes and general maintenance will cease. Security fixes only.
PHP 8.5 reaches end of life. Please upgrade to a newer version.
Upgrading to PHP 8.5 from earlier versions
Download PHP 8.5 for your platform
Pre-built binaries for Windows, including thread-safe and non-thread-safe versions.
Download for Windows