Re: [RFC] Pipe Operator (again)

From: Date: Fri, 07 Feb 2025 23:47:40 +0000
Subject: Re: [RFC] Pipe Operator (again)
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 07.02.2025 at 23:54, Rob Landers wrote:

> Put another way, what is the order of operations for this new operator?
>
> For example, what is the output of
>
> $x ? $y |> strlen(…) : $z
>
> $x + $y |> sqrt(…) . EOL
>
> Etc.

According to the reference implementation[1], that would be equivalent to

  $x ? ($y |> strlen(…)) : $z

  ($x + $y) |> (sqrt(…) . EOL)

> I noticed this seems to be missing from the RFC. As a new operator, I think it should be
> important to specify that.

Indeed, precendence and associativity need to be mentioned in the RFC.

[1] <https://github.com/php/php-src/pull/17118>

Christoph


Thread (42 messages)

« previous php.internals (#126346) next »