Skip to content
Wade Womersley

wade.one

wade womersley – york based software engineer

  • Home
  • 2026
  • May
  • 9
  • PHP 8.5’s Pipe Operator Is for Readable Code, Not Clever Code

PHP 8.5’s Pipe Operator Is for Readable Code, Not Clever Code

Posted on May 9, 2026 By
PHP, Programming

The pipe operator in PHP 8.5 is going to be one of those features people either underuse or overuse. I like it, but only for the boring reason: it can make transformation code read in the order it actually happens. That is useful. Turning every function call into a pipeline because the syntax is new is not.

The PHP 8.5 release notes describe |> as a way to chain callables left-to-right, and the pipe operator RFC frames it as immediate function composition. The simple example is a slug pipeline: trim a string, replace spaces, strip punctuation, lower-case it. Written as nested calls, that kind of code reads inside-out. Written as a pipeline, it reads like a small recipe.

Where I would use it is in code that already has a clear sequence of transformations. Normalising imported data, preparing text, shaping API input, or passing a value through small named functions are all reasonable fits. Where I would avoid it is business logic with branching, side effects, unclear intermediate state, or callbacks that need long inline closures. At that point the pipe operator is not making the code clearer. It is just making the clever version shorter.

The best PHP features tend to work like this. They give you a cleaner expression for something you were already doing, but they do not remove the need to choose good boundaries. Used carefully, |> should make some code easier to scan in review. Used everywhere, it will just create a new style of unreadable PHP.

Share:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit

Related

Comments

comments

Tags: php php-8-5 pipe-operator refactoring

Post navigation

❮ Previous Post: PHP 8.5’s URI Extension Fixes a Real Web Problem
Next Post: PHP 8.5 Clone With Makes Value Objects Less Annoying ❯

You may also like

Programming
PHP5.4.3 Available on Dotdeb.org (Installs fine on Ubuntu)
May 22, 2012
AI
CodeQL’s System Prompt Injection Query Is a Useful Start
July 15, 2026
Programming
What Makes an API Feel Nice to Work With
April 5, 2026
Programming
Why Logging Is Still a Product Feature
April 18, 2026
  • AI
  • artificial intelligence
  • Ego-centric
  • Events
  • Films
  • Food
  • Gaming
  • Gym
  • Hardware
  • Holidays
  • News
  • PHP
  • Programming
  • Random Stuff
  • Reviews
  • Science
  • SEO
  • Software
  • Software Engineer
  • Support
  • Uncategorized
  • Work

Categories

  • AI
  • artificial intelligence
  • Ego-centric
  • Events
  • Films
  • Food
  • Gaming
  • Gym
  • Hardware
  • Holidays
  • News
  • PHP
  • Programming
  • Random Stuff
  • Reviews
  • Science
  • SEO
  • Software
  • Software Engineer
  • Support
  • Uncategorized
  • Work

Archives

  • November 2026
  • October 2026
  • August 2026
  • July 2026
  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • August 2023
  • April 2023
  • March 2023
  • April 2016
  • October 2015
  • July 2015
  • June 2015
  • May 2015
  • March 2015
  • February 2015
  • January 2015
  • October 2014
  • December 2013
  • September 2013
  • June 2013
  • October 2012
  • May 2012
  • March 2012
  • February 2012
  • April 2011
  • March 2011
  • October 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009

Copyright © 2026 wade.one.

Theme: Oceanly News Dark by ScriptsTown