Re: [RFC] Destructuring Coalesce

From: Date: Tue, 01 Nov 2022 09:06:02 +0000
Subject: Re: [RFC] Destructuring Coalesce
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-118936@lists.php.net to get a copy of this message
On 01/11/2022 00:05, Bob Weinand wrote:
Am 16.10.2022 um 23:11 schrieb Bob Weinand <bobwei9@hotmail.com>: Hey, I've written a small RFC about adding coalesce ability to list() destructuring. This should enhance the ability to easily, concisely and readably destructure arrays with default values. https://wiki.php.net/rfc/destructuring_coalesce <https://wiki.php.net/rfc/destructuring_coalesce> Bob
Hey, Given haven't heard much feedback, I'll open the vote by end of the week, Bob
Unless I'm missing something, the one response you did get contained some questions that you didn't answer? As for my own reaction: the simple examples look useful, and maybe are enough to include the feature. I find nested destructuring a bit confusing to read at the best of times, and some of the examples like [[$a ?? "default"] ?? []] = $array make me go a bit cross-eyed, but you make a reasonable case for the choice of semantics, and I don't really have a strong reason *not* to allow it. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#118936) next »