DEV Community

Discussion on: Arrow Functions in PHP

Collapse
 
stegriff profile image
Ste Griffiths

It would be really great if they implemented the arrow functions RFC!

I came across it today because I'm a .Net+JS dev helping a colleague to write a PHP app talking to our API. And I knew he would need to do something like .Where from LINQ or .filter from JS.

So I found the PHP functions like array_filter, but with the long closures syntax it's just so much code! And like you say, you need the use () clause. It's messy. Arrow functions would be brilliant in PHP.

Thanks for the post!