Ancestors

Toot

Written by Greg Korba on 2024-12-06 at 14:15

"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

=> View attached media

=> More informations about this toot | More toots from codito@mas.to

Descendants

Written by Greg Korba on 2024-12-06 at 14:16

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 🙏😆.

=> View attached media

=> More informations about this toot | More toots from codito@mas.to

Written by Larry Garfield on 2024-12-06 at 15:50

@codito @PHPCSFixer Please never do this.

=> More informations about this toot | More toots from Crell@phpc.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113606298837415279
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
260.949566 milliseconds
Gemini-to-HTML Time
0.72854 milliseconds

This content has been proxied by September (3851b).