Who else thinks PHP arrow functions should:
- Support multiline bodies with {} for more complex logic? 📜
- Or at least explicitly support void as a return type for clarity in no-return scenarios? 📷
#PHP #Laravel
Back
•
This is what arrow functions should be like. The implementation that JS uses for arrow functions is great TBH.
I agree. Nuno, Larry, and Arnaud authored a great RFC for this back in 2022. (in case you weren't already aware)
wiki.php.net/rfc/auto-capture-closure
I second the void return type, but not the multiline body: that's why closures exist.