Problem/Motivation
PHP arrow functions are a useful shorthand for inline anonymous functions, e.g. when used as a custom callback to a PHP function such as array_filter().
Several questions arise that I can see:
1. Do we need standards on when to use these vs. normal anonymous functions?
2. Typically, they are written to be fairly compact. Do we need to suspend the coding standard for variable names not using abbreviations, in particular the function parameters?
Comments
Comment #2
eric_a commentedComment #3
eric_a commentedComment #4
eric_a commentedFrom https://www.php-fig.org/per/coding-style/#71-short-closures:
Comment #5
drunken monkey@eric_a: Seems we’re currently pretty undecided on that, so seems like a good thing for which to put a standard in place. And probably to use the one from FIG, then. (Even though I personally prefer it with the space.)
Comment #6
joachim commented@eric_a yes, but what's their reasoning for the difference?