Latest in branch 8.5
8.5.7
Released 04 Jun 2026
(6 days ago)
SoftwarePHP
Version8.5
Status
Supported
Initial release8.5.0
20 Nov 2025
(6 months ago)
Latest release8.5.7
04 Jun 2026
(6 days ago)
End of bug fixes31 Dec 2027
(Ends in 1 year, 6 months)
End of security fixes31 Dec 2029
(Ends in 3 years, 6 months)
Release noteshttps://www.php.net/ChangeLog-8.php#8.5.7
Source codehttps://github.com/php/php-src/tree/php-8.5.7
Documentationhttps://www.php.net/manual/en/
Downloadhttps://www.php.net/releases/8.5.7
PHP 8.5 ReleasesView full list

What is New in PHP 8.5

PHP 8.5 is a major release that introduces several powerful features, improves developer experience, and continues to strengthen type safety and performance. Below are the most important changes and additions.

Key New Features

Built-in URI Extension

A new core extension for parsing, normalizing, and building URLs according to RFC 3986 and the WHATWG URL specification.

Pipe Operator (|>)

Allows clean left-to-right function chaining. The value on the left is automatically passed as the first argument to the callable on the right.

$result = $input
    |> trim(...)
    |> htmlspecialchars(...)
    |> strlen(...);
Clone With Syntax

Clone an object and modify selected properties in one expression. Especially useful with readonly classes.

$copy = clone $user with { $name = 'New Name', $active = true };
#[\NoDiscard] Attribute

Marks methods whose return value must not be ignored. Ignoring it triggers a compile-time warning.

#[\NoDiscard]
function compute(): int { ... }
array_first() and array_last()

Convenient helpers that return the first or last array element, or null if the array is empty.

$head = array_first($items) ?? 'default';
$tail = array_last($items);
Persistent cURL Share Handles

curl_share_init_persistent() creates share handles that survive across requests, reusing cookies, DNS cache, and connections automatically.

Other Notable Improvements

  • Fatal errors now include a full backtrace.
  • Attributes can target constants.
  • #[\Override] attribute now works on properties.
  • #[\Deprecated] attribute can be used on traits and constants.
  • Static properties support asymmetric visibility.
  • Constructor-promoted properties can be declared final.
  • New Closure::getCurrent() method simplifies recursive anonymous functions.
  • setcookie() and setrawcookie() support the "partitioned" attribute for CHIPS cookies.
  • New functions: get_error_handler() and get_exception_handler().
  • DOM gains Element::getElementsByClassName() and insertAdjacentHTML().
  • New grapheme_levenshtein() function.
  • Static closures and first-class callables are allowed in constant expressions.

Deprecations and BC Breaks

Feature Status / Change
Backtick operator `...` Deprecated (alias of shell_exec())
Non-standard casts (boolean), (integer), (double), (binary) deprecated -> use (bool), (int), (float), (string)
disable_classes ini directive Removed
Case statement ending with semicolon Deprecated (must use colon)
Using null as array key or in array_key_exists() Deprecated
class_alias() with "array" or "callable" as alias name No longer allowed
__sleep() and __wakeup() Soft-deprecated -> prefer __serialize() / __unserialize()
Casting NAN to other types Now emits a warning
Destructuring non-traversables with [] or list() Warning (except for null)
Casting floats that lose precision to int Now emits a warning

Final Thoughts

PHP 8.5 delivers cleaner syntax with the pipe operator and clone-with expression, stronger safety through new attributes and warnings, and useful helpers that reduce boilerplate. These changes make everyday coding more enjoyable while preparing the language for future improvements.

Releases In Branch 8.5

VersionRelease date
8.5.704 Jun 2026
(6 days ago)
8.5.607 May 2026
(1 month ago)
8.5.509 Apr 2026
(2 months ago)
8.5.412 Mar 2026
(2 months ago)
8.5.312 Feb 2026
(3 months ago)
8.5.215 Jan 2026
(4 months ago)
8.5.118 Dec 2025
(5 months ago)
8.5.020 Nov 2025
(6 months ago)