khalyomede's avatar

Khalyomede

khalyomede

Member since

40

Total Reputation

1

Total Arguments

2

Total Votes for Arguments

Arguments and votes

3

This will help make code more readable in situations when we have to chain many built-in functions and is a good entrypoint for making pure minimalistic functions a first class citizen in PHP.

Share:
Read the RFC: The Pipe Operator khalyomede avatar
khalyomede
voted yes
87

With First-class callable syntax available since 8.1, it would now be possible to write it as below, which is much better then string names of functions:

$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 pronskiy avatar
pronskiy
voted yes
RSS Feed Contribute Watch on YouTube Our License
© 2024 RFC Vote. This project is open source. Contribute and collaborate with us!