Re: [PHP-DEV] Proposal: Shorthand initialization and destructuring of associative arrays

2021-10-04 Thread Sara Golemon
On Mon, Oct 4, 2021 at 2:15 PM Konrad Baumgart wrote: > > I have spare time this October, so I would happily get into php > interpreter by developing this. > Unfortunately my plans to have spare time FAILED and I'm not able to > contribute in the near future. > > I'm procrastinating writing slide

Re: [PHP-DEV] Proposal: Shorthand initialization and destructuring of associative arrays

2021-10-04 Thread Konrad Baumgart
> I have spare time this October, so I would happily get into php interpreter > by developing this. Unfortunately my plans to have spare time FAILED and I'm not able to contribute in the near future. > If something like this were to be introduced, I'd happily see it happen with > anonymous objec

Re: [PHP-DEV] Proposal: Shorthand initialization and destructuring of associative arrays

2021-10-04 Thread Nikita Popov
On Mon, Sep 27, 2021 at 11:27 AM Konrad Baumgart wrote: > Hi everyone, > > I'd like to propose 2 syntactic sugars: > $array = [ => $data]; // the same as $array = ['data' => $data] > and > [ => $data] = $array; // the same as ['data' => $data] = $array > > My biggest use-case for this would be co

Re: [PHP-DEV] Proposal: Shorthand initialization and destructuring of associative arrays

2021-09-27 Thread Lynn
On Mon, Sep 27, 2021 at 11:27 AM Konrad Baumgart wrote: > I was recently developing with js/ts and I liked the ease of returning > multiple items from a function as an object, while still preserving > their name. > I recently encountered this as well in Typescript. I believe the syntax is someth

[PHP-DEV] Proposal: Shorthand initialization and destructuring of associative arrays

2021-09-27 Thread Konrad Baumgart
Hi everyone, I'd like to propose 2 syntactic sugars: $array = [ => $data]; // the same as $array = ['data' => $data] and [ => $data] = $array; // the same as ['data' => $data] = $array My biggest use-case for this would be conveniently returning multiple things from a function, like: function ge