jbrooksuk's avatar

James Brooks

jbrooksuk

Member since

Laravel

35

Total Reputation

2

Total Arguments

3

Total Votes for Arguments

Arguments and votes

1

I like what the pipe operator provides, but I don't like the string-based syntax that's proposed. It feels weird to me that we're calling functions, but providing them as strings. Yes, we do this with call_user_func but that's called as a parameter. The proposed syntax is very different to that.

Share:
Read the RFC: The Pipe Operator Laravel jbrooksuk avatar
jbrooksuk
voted no
1

As many have already said, this is a common feature in other languages. As it stands, PHP has a half-baked version of short closures since introducing arrow functions. This is the natural next step.

Share:
Read the RFC: Short Closures 2.0 Laravel jbrooksuk avatar
jbrooksuk
voted yes
65

For me, the most important argument is that the pipeline pattern is a tried and tested pattern, that this RFC builds upon. A couple of examples:

This RFC adds syntax to make using these kinds of pattern much more convenient.

On top of that, there's the argument that multiple modern languages support a pipe operator:

Finally, I've had numerous occasions where a pipe operator would simplify my own code — I have more than a handful real life cases where this would be useful.

Share:
Read the RFC: The Pipe Operator Contributor brent avatar
brent
voted yes
RSS Feed Contribute Watch on YouTube Our License
© 2024 RFC Vote. This project is open source. Contribute and collaborate with us!