On Tuesday, July 14th, 2026 at 03:22, Tim Düsterhus <[email protected]> wrote:
> Thank you. One note regarding “the lowest precedence level,
> right-associative”. This is not quite correct. While the assignment
> operators have fairly low precedence, they are not the lowest. As an
> example, the infamous `$foo = bar() or die()` pattern relies on `or`
> having a lower precedence than assignment. This should be corrected.
> 
> The `$result = ($x |>= double(...)) |> triple(...);` example also
> doesn't showcase precedence, because of the explicit parentheses.

Ah, yes. I meant among the symbolic operators but you are correct and I've
updated to make this more clear. I removed the explicit parentheses from the
example.

> Looking at the RFC examples again, I was reminded of this RFC:
> https://wiki.php.net/rfc/implicit_move_optimisation, which concerns
> itself with optimizing the `$foo = func($foo);` case. Perhaps it makes
> sense to list this in the references section, because with `|>=` this
> “in-place” reassignment would become an official pattern.

I've added this to the references and discussed it in the Future Scope
section.

Best,
Caleb

Reply via email to