PHP 8.5 lays down long-awaited pipe operator, adds new URI tools
Summary
PHP 8.5, released 20 November 2025, introduces several notable language improvements. The headline feature is a new pipe operator (|>) that makes chaining function calls and serial transformations far cleaner and more readable. PHP also gains a standards‑compliant URI extension implementing RFC 3986 and WHATWG URL behaviour, replacing the long‑standing reliance on parse_url() for many parsing tasks. Other additions include Clone With for easier object cloning with modified properties, a #[\NoDiscard] attribute to warn on ignored return values, constant expressions that may use static closures and first‑class callables, and persistent cURL handles that can be shared across requests.
Key Points
- Pipe operator (|>) enables sequential function chaining, reducing temporary variables and nested calls for clearer code.
- New URI extension provides standards‑compliant parsing and manipulation of URIs/URLs (RFC 3986 and WHATWG), addressing limitations of parse_url().
- Clone With syntax streamlines creating modified copies of objects without verbose code.
- The #[\NoDiscard] attribute helps catch cases where important return values are ignored.
- Support for static closures and first‑class callables in constant expressions, plus persistent cURL share handles across requests.
Context and relevance
These changes modernise everyday PHP development. The pipe operator is a concise, high‑impact quality‑of‑life improvement seen in several other languages and should make data‑transformation code more readable. The new URI extension fills a critical standards gap in the standard library, improving safety when dealing with untrusted or malformed URLs. Combined with smaller additions (Clone With, NoDiscard, persistent cURL handles), 8.5 focuses on safer, clearer and slightly more performant web development patterns — important for frameworks and projects like WordPress and Laravel that sit atop PHP.
Author style
Punchy: this isn’t a gimmick release — the pipe operator is a real win for readable code, and the URI tools close a longstanding hole in the standard library. If you maintain PHP projects or frameworks, the details matter; skim at your peril.
Why should I read this?
Look — you write, ship or maintain PHP code. This update makes common tasks less awkward and safer. The pipe operator alone will save you boilerplate and mental overhead; the URI extension saves you from subtle parsing bugs. Worth five minutes to scan the changes and consider upgrading or testing your apps.
Source
Source: https://www.theregister.com/2025/11/20/php_85_lays_pipe_operator/
