Skip to content
PHP News
Search
Declined PHP 8.6

Pipe Assignment Operator

Adds a |>= operator so $x |>= trim(...) pipes a variable through a function and assigns the result back.

Implement the pipe assignment operator as outlined in the RFC?

Primary vote · 2/3 majority

14 Yes 12 No 7 abstain 54% approval

This poll has closed.

Declined. Voting closed on August 11, 2026 with 14 in favor, 12 against and 7 abstaining. That's 54% support against the two-thirds majority it needed.

Summary

PHP 8.5 added the pipe operator (|>), and a common way to use it is to pipe a variable through a few functions and assign the result back to the same variable. This RFC from Caleb White proposed |>=, a compound assignment version of the pipe, in the same family as +=, .= and ??=. It was declined.

What it would have looked like

$x |>= callable means the same thing as $x = $x |> callable. When the right side is a pipe chain, the variable goes in at the start of the chain:

// Today
$this->requestData = $this->requestData |> array_filter(...);

$input = trim($input) |> strtolower(...);

// With |>=
$this->requestData |>= array_filter(...);

$input |>= trim(...) |> strtolower(...);

It would have worked on anything that takes compound assignment today: plain variables, array keys, object properties and static properties. Every callable style |> accepts would work too, including partial function application like str_replace('a', 'b', ?). Arrow functions would need parentheses, the same as with |>.

The RFC also points out a small correctness win. With $arr[expensive_call()] |>= strtoupper(...), expensive_call() runs once. Written out as $x = $x |> ..., the left-hand expression gets evaluated on both sides of the assignment. That's the same guarantee ??= gives you over $x = $x ?? $default.

What it means for existing code

Nothing. |>= is a syntax error in every PHP version today, so the RFC had no backward compatibility breaks. The tokenizer would have gained a T_PIPE_EQUAL constant, and IDEs and static analyzers would have needed to learn the new token.

With the RFC declined, you keep writing $x = $x |> .... The RFC also links a competing proposal, the left-to-right assignment operator, which wants the same |>= token for something else.

Our coverage

  • PHP 8.6 Beta 1

    PHP 8.6 Beta 1

    · PHP Core