ralphjsmit's avatar

Ralph J. Smit

ralphjsmit

Member since

20

Total Reputation

1

Total Arguments

2

Total Votes for Arguments

Arguments and votes

1

I think I would be fine if this had been in PHP all along, but for all existing developers this proposal really messes up my feeling for reading code. PHP always considers a space between words/symbols as a separator between two things. If you want to combine the result of that, you need to always use parentheses, so why create an exception here?

Share:
Read the RFC: new MyClass()->method() without parentheses ralphjsmit avatar
ralphjsmit
voted no
88

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!