Critical PHP2Shell: two unauthenticated RCE flaws in PHP itself. Fixes shipped on 21 Oct 2026. Check if you are affected →
← All news

PHP 8.5 Released: Pipe Operator, URI Extension and Clone With

PHP 8.5 shipped on 20 November 2025 with the |> pipe operator, a built-in URI extension, clone-with syntax and the #[\NoDiscard] attribute.

PHP 8.5.0 was released on 20 November 2025. Highlights from the official announcement:

  • Pipe operator (|>) – chain single-argument callables left to right instead of nesting calls:
$slug = $title
    |> trim(...)
    |> (fn($s) => str_replace(' ', '-', $s))
    |> strtolower(...);
  • URI extension – an always-available extension (Uri\Rfc3986\Uri, Uri\WhatWg\Url) to parse and modify URLs according to RFC 3986 and the WHATWG URL standard, a safer alternative to parse_url().
  • Clone With – clone($obj, ['prop' => $value]) makes the "with-er" pattern easy for readonly classes.
  • #[\NoDiscard] attribute – warns when an important return value is ignored.
  • Closures and first-class callables in constant expressions, e.g. in attribute arguments.
  • Persistent cURL share handles across requests.

The migration guide in the PHP manual lists the deprecations and backward-incompatible changes to check before upgrading.

Source: php.net PHP 8.5 announcement

Planning a jump from an older PHP version to 8.5? RescuePHP can audit your codebase and handle the upgrade step by step.