
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.
Popular Backend topics

New
New

It’s not legacy code — it’s PHP.
Vimeo has been using PHP in production for over 15 years. Find out how we keep a million lines of PHP i...
New

Post on using UDP multicasting with Elixir to broadcast presence, and listen for peers, on a local network. I have found this approach us...
New

Ruby on Rails is a web framework that contains many libraries you’d need to create and deploy a successful web application. We often take...
New

I’ve been more serious about learning Rust recently, after dragging on with passive learning for a while. My first real programming langu...
New

This was posted on the Elixir Forum and thought it was worth sharing here!
I love how the excitement of the author shines through and I ...
New

Louis Pilfold is the creator of the Gleam programming language. He explains what Gleam is and tells us where it came from.
He then dives...
New

When DoorDash approached the limits of what our Django-based monolithic codebase could support, we needed to design a new stack that woul...
New

In building lofi.limo, media storage and distribution naturally came up. I have songs, announcements, and background image loops which I ...
New
Other popular topics

What chair do you have while working… and why?
Is there a ‘best’ type of chair or working position for developers?
New

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

I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New

Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face:
https://on...
New

Just done a fresh install of macOS Big Sur and on installing Erlang I am getting:
asdf install erlang 23.1.2
Configure failed.
checking ...
New

I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New

Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New

I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New

Author Spotlight
Mike Riley
@mriley
This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New

Author Spotlight
Erin Dees
@undees
Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /onivim
- /typescript
- /svelte
- /crystal
- /kotlin
- /c-plus-plus
- /tailwind
- /gleam
- /react
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /html
- /opensuse
- /centos
- /php
- /deepseek
- /zig
- /scala
- /textmate
- /sublime-text
- /lisp
- /nixos
- /debian
- /react-native
- /agda
- /kubuntu
- /arch-linux
- /django
- /revery
- /ubuntu
- /spring
- /manjaro
- /nodejs
- /diversity
- /lua
- /julia
- /c
- /slackware
- /markdown