Latest stable release

PHP 8.5.7

The modern, fast and pragmatic language that powers the web — better syntax, improved performance and real type safety.

Released 04 Jun 2026
8.28.38.48.5

What's new in 8.5

Key features of this release
01

URI Extension

The new always-available URI extension provides APIs to securely parse and modify URIs and URLs according to the RFC 3986 and the WHATWG URL standards.Powered by the uriparser (RFC 3986) and Lexbor (WHATWG URL) libraries.Learn more about the backstory of this…

02

Pipe Operator

The pipe operator allows chaining function calls together without dealing with intermediary variables. This enables replacing many "nested calls" with a chain that can be read forwards, rather than inside-out.Learn more about the backstory of this feature in…

03

Clone With

It is now possible to update properties during object cloning by passing an associative array to the clone() function. This enables straightforward support of the "with-er" pattern for readonly classes. PHP 8.4 and older readonly class Color { public function…

04

#[\NoDiscard] Attribute

By adding the #[\NoDiscard] attribute to a function, PHP will check whether the returned value is consumed and emit a warning if it is not. This allows improving the safety of APIs where the returned value is important, but it's easy to forget using the…

05

Closures and First-Class Callables in Constant Expressions

Static closures and first-class callables can now be used in constant expressions. This includes attribute parameters, default values of properties and parameters, and constants. PHP 8.4 and older final class PostsController { #[AccessControl( new…

06

Persistent cURL Share Handles

Unlike curl_share_init(), handles created by curl_share_init_persistent() will not be destroyed at the end of the PHP request. If a persistent share handle with the same set of share options is found, it will be reused, avoiding the cost of initializing cURL…

07

array_first() and array_last() functions

The array_first() and array_last() functions return the first or last value of an array, respectively. If the array is empty, null is returned (making it easy to compose with the ?? operator). PHP 8.4 and older $lastEvent = $events === [] ? null…

Why PHP today

Beyond any single release

⚡ Fast

A mature JIT compiler and years of engine work make today's PHP an order of magnitude faster than legacy versions.

🛡️ Type-safe

Union types, enums, readonly properties and strict typing let the engine catch whole classes of bugs for you.

📦 Rich ecosystem

Composer, Packagist and frameworks like Laravel and Symfony give you a battle-tested toolkit for anything web.

🌍 Everywhere

Powering a huge share of the web, PHP runs on virtually every host and scales from a tiny script to global platforms.