william-2's avatar

William Hleucka

william-2

Member since

90

Total Reputation

2

Total Arguments

2

Total Votes for Arguments

Arguments and votes

7

I think this would be a great improvement.

I prefer this:

$result = "Hello World"
    |> htmlentities(...)
    |> str_split(...)
    |> fn($x) => array_map(strtoupper(...), $x)
    |> fn($x) => array_filter($x, fn($v) => $v != 'O');

instead of this:

$result = "Hello World"
    |> 'htmlentities'
    |> 'str_split'
    |> fn($x) => array_map('strtoupper', $x)
    |> fn($x) => array_filter($x, fn($v) => $v != 'O');
Share:
Read the RFC: The Pipe Operator william-2 avatar
william-2
voted yes
1

I would really love this!

Share:
Read the RFC: Short Closures 2.0 william-2 avatar
william-2
voted yes
RSS Feed Contribute Watch on YouTube Our License
© 2024 RFC Vote. This project is open source. Contribute and collaborate with us!