PHP Named Arguments and First-Class Callable Syntax in WordPress Plugins
PHP 8.0 named arguments and PHP 8.1 first-class callable syntax (strlen(...)) are two underused features that improve readability and safety in WordPress plugin code. Named arguments eliminate the need to look up parameter order in function signatures and make optional parameters self-documenting. First-class callables create a Closure from any callable without wrapping it in an…
Details