PHP 8.5 was released on November 20, 2025. The article presents it as the version to target almost a year later. Laravel 12 and 13 support PHP 8.3 through 8.5, hosting platforms offer PHP 8.5, and the next PHP release is due in November. The author sees the pipe operator as the release’s biggest syntax change.

slug-pipeline.php
$title = ' PHP 8.5 Released ';
$slug = $title
 |> trim(...)
 |> (fn($str) => str_replace(' ', '-', $str))
 |> (fn($str) => str_replace('.', '', $str))
 |> strtolower(...);

The pipe operator sends the value on its left to the callable on its right. A chain therefore follows execution from top to bottom. Each step must accept one argument. First-class callable syntax such as trim(...) covers single-argument functions, and other cases use a parenthesized arrow function. Pipes work with ordinary PHP functions and need no collection or wrapper object. The example converts " PHP 8.5 Released " into the slug "php-85-released".

PHP 8.5 adds a built-in URI extension. It follows the RFC 3986 and WHATWG URL standards and returns an object, giving parse_url() a standards-based alternative to its array result. Uri\Rfc3986\Uri can parse https://php.net/releases/8.5/en.php, and getHost() returns "php.net".

Readonly objects can receive one changed property through clone($this, ['alpha' => $alpha]). The #[\NoDiscard] attribute warns when a caller ignores a return value that should be checked. An explicit (void) cast marks an intentional discard. array_first() and array_last() provide direct access to the first and last array values, and both return null for an empty array.

Static closures and first-class callables can now appear in constant expressions, including attribute arguments. That lets applications use type-checked code where string-based rules were previously required. Other changes include backtraces in fatal errors, curl_share_init_persistent() for reusing DNS data and connections across requests, #[\Override] on properties, final in constructor promotion, and get_error_handler() plus get_exception_handler() for inspecting installed handlers.

The upgrade adds deprecations for the backtick shell operator, which should be replaced with shell_exec('ls'), and for the cast names (boolean), (integer), (double), and (binary), with (bool), (int), (float), and (string) as the replacements. null array keys now call for an explicit '' key. A switch case ending in a semicolon should use a colon. __sleep() and __wakeup() are soft-deprecated in favor of __serialize() and __unserialize(). The disable_classes INI setting has been removed without a replacement.

PHP 8.5 also warns when code casts NAN, destructures a non-array, or converts a float that cannot fit into an int. Teams should run their test suites with deprecations enabled before production deployment. The article recommends pipes for plain PHP helpers, actions, and data mappers, clone updates for DTOs and value objects, and #[\NoDiscard] on methods such as save() when a false result signals failure.