Re: [RFC] Destructuring Coalesce
| From: | Bob Weinand | Date: | Thu, 03 Nov 2022 20:10:02 +0000 |
| Subject: | Re: [RFC] Destructuring Coalesce | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118956@lists.php.net to get a copy of this message | ||
> Am 03.11.2022 um 20:55 schrieb Tim Düsterhus <tim@bastelstu.be>:
>
> Hi
>
> On 10/16/22 23:11, Bob Weinand wrote:
>> 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>
>
> Unless I missed anything, all the examples in the RFC deal with *absent* array keys. Can you
> also add an example where the key is present, but the value is 'null' to make the behavior
> with regard to that explicit?
>
> Best regards
> Tim Düsterhus
There was actually one line saying ... if $array[0] is null or does not exist, but I've added
a more specific example under use cases.
Bob