"Closures in constant expressions" #PHP RFC was accepted and implemented, so in the next non-patch version (8.5 / 9.0) it will be possible to assign closures as a default values for class properties or function arguments. WDYT 🤔?
https://wiki.php.net/rfc/closures_in_const_expr
https://3v4l.org/8bLVZ/rfc#vgit.master
=> More informations about this toot | More toots from codito@mas.to
Interestingly, properties with closures assigned as default value can also have property hooks, which makes the syntax a bit too curly 🙈. Imagine default closure with actual body + hooks...... oof, let's pray for @PHPCSFixer 🙏😆.
=> More informations about this toot | More toots from codito@mas.to
@codito @PHPCSFixer Please never do this.
=> More informations about this toot | More toots from Crell@phpc.social This content has been proxied by September (3851b).Proxy Information
text/gemini