Re: Re: [RFC] Short Array Variable Shorthand

From: Date: Wed, 30 Sep 2026 08:19:28 +0000
Subject: Re: Re: [RFC] Short Array Variable Shorthand
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-132710@lists.php.net to get a copy of this message
On Tue, Sep 29, 2026 at 8:38 PM Weilin Du <weilin-du@qq.com> wrote: > Hi, > > Some amendment have been added after this email. > We are using the = char instead of > : > > ``` > $point = [=$x, =$y]; > ``` > > And we are supporting array() and list() for this RFC now, > so not only []. > > See the RFC for reasons. Discussions have happened in > the official phpc's discord server and thanks Tim Düsterhus > for the ideas. > > This RFC is still in a very early stage. So there can be vagueness > and obvious issues. If there is, please point out. > > Thanks, > Weilin Du Have you checked if it is possible to use the arrow itself instead? To me this syntax feels more familiar, especially when using multiple lines. Currently this is a syntax error and should be usable (question mark?). ```php $point = [ => $x, => $y, ]; $user => [ 'id' => 1, => $name, => $email, ]; ``` I saw some mentions of compact and extract, I will never use those because they are confusing to read and understand, where as this RFC is explicit in what it does.

« previous php.internals (#132710) next »