On Friday, 7 February 2025 at 04:57, Larry Garfield <[email protected]> wrote:
> Hi folks. A few years ago I posted an RFC for a pipe operator, as seen in many other languages.
> At the time it didn't pass, in no small part because the implementation was a bit shaky and it
> was right before freeze. Nonetheless, there are now even more (bad) user-space implementations in
> the wild, as it gets brought up frequently in "what do you want in PHP?" threads (though
> nowhere near generics or better async, of course), so it seems clear there is demand in the market
> for it.
>
> It is now back with a better implementation (many thanks to Ilija for his help and guidance in
> that), and it's nowhere close to freeze, so here we go again:
>
> https://wiki.php.net/rfc/pipe-operator-v3
>
> Of particular note, since the last RFC I have concluded that a compose operator is a necessary
> complement to a pipe operator. However, it's also going to be notably more work, and the two
> operators don't actually interact at all at the code level, so since people keep saying
> "Small RFCs!", here's a small RFC. :-)
I'm very much in favour of this RFC, it will make writing functional and date pipeline code
less cumbersome.
I was curious *how* the blocking of by-ref parameter is done, and was pleasantly surprised that it
is done at run-time, so "prefer-by-ref" parameters work without issues.
This is good motivation for me to go back and push the by-value sort() RFC [1] as it uses that
mechanism.
I've also submitted a PR [1] to add such a test case.
Probably a good idea to specify this in the RFC.
Best regards,
Gina P. Banyard
[1] https://wiki.php.net/rfc/array-sort-return-array
[2] https://github.com/Crell/php-src/pull/1