Re: [RFC] Pipe Assignment Operator
| From: | Tim Düsterhus | Date: | Mon, 20 Jul 2026 15:24:20 +0000 |
| Subject: | Re: [RFC] Pipe Assignment Operator | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132052@lists.php.net to get a copy of this message | ||
Hi
On 2026-07-20 16:55, Bob Weinand wrote:
I just have one more question to the RFC author, which I see in the implementation, but the RFC is not explicitly noting: Is it intentional that fetching is repeated?I would consider that a bug in the implementation, given that the “Single-Evaluation Guarantee” section mentions:
When the LHS contains sub-expressions, they are evaluated exactly once:and
This is the same guarantee that ??= provides over $x = $x ?? default, implemented using the same compile-time memoization mechanism.Thus if it behaves differently to
??=, it's a bug in the implementation :-)
Best regards
Tim Düsterhus