CommunityNews

CommunityNews

Why we need multi-line short closures in PHP

PHP 8.1 is already taking shape quite well, yet there’s one feature I’d love to see added, that’s still being discussed: multi-line short closures. The RFC calls them “Auto-capturing multi-statement closures” but I hope you don’t mind me using the somewhat shorter name.

If you’re on an actively supported PHP version, you already know about short closures — a.k.a. “arrow functions”. And, most importantly, one of their biggest drawbacks: they only support one-line expressions, which are also used as the return value.

The multi-line short closures RFC by Nuno and Larry aims to solve that problem, in — what I think is — an elegant way.

Read in full here:

This thread was posted by one of our members via one of our news source trackers.

First Post!

bot

bot

Corresponding tweet for this thread:

Share link for this tweet.

Popular Backend topics Top

First poster: bot
The unreasonable effectiveness of the Julia programming language. Fortran has ruled scientific computing, but Julia emerged for large-sc...
New
CommunityNews
Is Zig the Long Awaited C Replacement. Comparison with previous C contenders such as C++, D, Java, C#, Go, Rust and Swift https://erik...
New
CommunityNews
Idioms for the D Programming Language This thread was posted by one of our members via one of our news source trackers.
New
First poster: bot
At Grammarly, the foundation of our business, our core grammar engine, is written in Common Lisp. It currently processes more than a thou...
New
CommunityNews
I don’t like reading thick O’Reilly books when I start learning new programming languages. Rather, I like starting by writing small and d...
New
elbrujohalcon
A long time ago, I wrote an article about The Asymmetry of ++, thanks to Fede Bergero’s findings. Let’s add a few more asymmetries to th...
New
wolf4earth
Tej Pochiraju joins the mix to discuss Progressive Web Apps and how you can support them using Elixir and Phoenix to control IoT devices....
New
brainlid
There is a new community resource available on writing “Safe Ecto Migrations”. When we get a migration wrong, it can lock up your product...
New
elbrujohalcon
Another week, another oldies-but-goldies post… This one about Test Driven Development.
New
ragamuf
Does the world need another How to create a blog article? Maybe not. But then again, creating something out of nothing is what we love....
New

Other popular topics Top

PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New

Latest in Blogs/Talks

View all threads ❯