On Tue, Sep 29, 2026 at 8:38 PM Weilin Du <[email protected]> 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.

Reply via email to