Re: [RFC] [DISCUSSION] Compact Object Property Assignment
| From: | Matthew Brown | Date: | Mon, 16 Mar 2020 14:10:16 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Compact Object Property Assignment | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109058@lists.php.net to get a copy of this message | ||
I love the idea!
The syntax for new objects looks a little verbose – would it be possible to
use
$foo = new Foo()[
property1 = "hello",
property2 = 5,
];
as an alternative to
$foo = (new Foo())->[
property1 = "hello",
property2 = 5,
];
On Mon, 16 Mar 2020 at 07:48, Jakob Givoni <jakob@givoni.dk> wrote:
> Hello Internals,
>
> I'm opening up my new RFC for discussion:
>
> https://wiki.php.net/rfc/compact-object-property-assignment
> - A pragmatic approach to object literals
>
> Let me know what you think!
>
> Best,
> Jakob
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>