TL;DR
PHP 8.4 adds the |> pipe operator for chaining function calls, borrowing syntax from F# and Elixir to enable more readable functional-style code composition.
Key Points
- New |> operator allows left-to-right function chaining: $x |> log() |> round(1) |> exp()
- Includes #[NoDiscard] attribute to flag functions whose return values shouldn't be ignored
- Partial function application RFC v2 currently in voting to improve pipe operator ergonomics
- Syntax mirrors F# and R pipelines but requires workarounds without first-class partial application
Why It Matters
The pipe operator makes deeply nested function calls more readable and maintainable, particularly valuable for data transformation pipelines common in backend services and data processing. However, PHP's lack of native partial application limits the feature's utility compared to functional languages, creating a gap between syntax and practical usability that the community is actively working to close.
Source: lwn.net