I am Taylor Otwell. Ask me anything.

View original thread
Steven Bock's photo

What's a feature from another language that you'd like to have in PHP? How could that feature make Laravel more awesome?

Taylor Otwell's photo

Creator of Laravel

I would love to have short Closures that work similarly to the new => syntax in JavaScript.

Something like this following:

array_map(foo => foo + 1, foos);

It would just clean up some noise in the code. I think certain aspects of testing could be cleaned up by the inclusion of a monkey patching extension like "uopz" in the core of the language. However, lately PHP is more focused on "safety" with static types and so on so I don't think such an extension would be viewed favorably in the current PHP environment. :)