News: 0180181091

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

PHP 8.5 Brings Long-Awaited Pipe Operator, Adds New URI Tools (theregister.com)

(Saturday November 22, 2025 @09:35PM (EditorDavid) from the piping-at-the-gates-of-dawn dept.)


"PHP 8.5 landed on Thursday with a long-awaited pipe operator and a new standards-compliant URI parser," [1]reports the Register , "marking one of the scripting language's more substantial updates... "

> The pipe operator allows function calls to be chained together, which avoids the extraneous variables and nested statements that might otherwise be involved. Pipes tend to make code more readable than other ways to implement serial operations. Anyone familiar with the Unix/Linux command line or programming languages like [2]R , [3]F# , [4]Clojure , or [5]Elixir may have used the pipe operator. In JavaScript, aka ECMAScript, [6]a pipe operator has been proposed , though there are alternatives like method chaining.

>

> Another significant addition is the [7]URI extension , which allows developers to parse and modify URIs and URLs based on both the RFC 3986 and the WHATWG URL standards. Parsing with URIs and URLs â" reading them and breaking them down into their different parts â" is a rather common task for web-oriented applications. Yet prior versions of PHP didn't include a standards-compliant parser in the standard library. As [8]noted by software developer Tim Düsterhus, the [9]parse_url() function that dates back to PHP 4 doesn't follow any standard and comes with a warning that it should not be used with untrusted or malformed URLs.

>

> Other noteworthy additions to the language include: [10]Clone With , for updating properties more efficiently; the [11]#[\NoDiscard] attribute , for warning when a return value goes unused; the ability to use [12]static closures and first-class callables in constant expressions; and [13]persistent cURL handles that can be shared across multiple PHP requests.



[1] https://www.theregister.com/2025/11/20/php_85_lays_pipe_operator/

[2] https://r4ds.had.co.nz/pipes.html

[3] https://camilotk.github.io/fsharp-by-example/chapters/pipe/

[4] https://clojure.org/guides/threading_macros

[5] https://elixirschool.com/en/lessons/basics/pipe_operator

[6] https://tc39.es/proposal-pipeline-operator/

[7] https://www.php.net/releases/8.5/en.php#new-uri-extension

[8] https://thephp.foundation/blog/2025/10/10/php-85-uri-extension/

[9] https://www.php.net/manual/en/function.parse-url.php

[10] https://www.php.net/releases/8.5/en.php#clone-with

[11] https://www.php.net/releases/8.5/en.php#no-discard-attribute

[12] https://www.php.net/releases/8.5/en.php#closures-in-const-expr

[13] https://www.php.net/releases/8.5/en.php#persistent-curl-share-handles



URI parser? (Score:1)

by theurge14 ( 820596 )

PHP didn't have a URI parser?

Re: (Score:2)

by karmawarrior ( 311177 )

It most certainly did. The summary even discusses it.

Re: (Score:1)

by h33t l4x0r ( 4107715 )

PHP coders actually prefer "rolling their own" URI parser because it makes them feel like bad-asses.

Re: (Score:1)

by Narcocide ( 102829 )

Well, it's really more because the stock one was broken.

What PHP needs (Score:2)

by hcs_$reboot ( 1536101 )

is a regex parser, like in Perl.

Re: (Score:1)

by Narcocide ( 102829 )

It has two .

Life is a POPULARITY CONTEST! I'm REFRESHINGLY CANDID!!