josebenraul's avatar

JoseBenRaul@gmail.com

josebenraul

Member since

235

Total Reputation

1

Total Arguments

1

Total Votes for Arguments

Arguments and votes

23

For example:

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

Is 'nicer' since it has better readability and clearer syntax than:

$result = array_filter(
        str_split(
            strtoupper(
                htmlentities("Hello World")
            )
        ),
        fn($v) => $v != '0'
    );
Share:
Read the RFC: The Pipe Operator josebenraul avatar
josebenraul
voted yes
RSS Feed Contribute Watch on YouTube Our License
© 2024 RFC Vote. This project is open source. Contribute and collaborate with us!