Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112848 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71182 invoked from network); 12 Jan 2021 16:32:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Jan 2021 16:32:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 52F2F1804A7 for ; Tue, 12 Jan 2021 08:10:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from v-smtpout1.han.skanova.net (v-smtpout1.han.skanova.net [81.236.60.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 12 Jan 2021 08:10:48 -0800 (PST) Received: from [192.168.7.11] ([213.64.245.126]) by cmsmtp with ESMTPA id zMFqkwKrz3UCOzMFqkx35c; Tue, 12 Jan 2021 17:10:46 +0100 To: Nikita Popov References: Cc: PHP internals Message-ID: <6767e898-122b-901f-1054-4faee31567e9@telia.com> Date: Tue, 12 Jan 2021 17:10:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: sv Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfF2jLbG2+gxOyFnPoPLQlVZkBrgu19tGU9ZH5Y/NfH1+3b5GgiXj1KlwXflEXSGoOyqoxyhtXW1T8MOKR8cXpmXXbV0b5t3T89YJBijFdBpa7OOxgmY/ KW6+tlm5JgOZSuCvpk4IzoTflWNWk9alYPLXyYYh3aCkUtcdD+Raexy8sMPsbPbW7BpOxdBHjozoeVgqtv+NBm0ilB4E5Rnp9vMkJlVSExH9huYPtrEqiV5Q Subject: Re: [RFC] Allow object keys in arrays From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2021-01-11 kl. 15:28, skrev Nikita Popov: > Hi internals, > > I would like to present a draft RFC for allowing object keys in arrays: > https://wiki.php.net/rfc/object_keys_in_arrays > > The specification in the RFC is incomplete, and primarily focussed on what > impact this has from an internal perspective. > https://github.com/php/php-src/pull/6588 is a draft implementation that > illustrates the necessary changes. > > The primary motivation, and reason why I am looking into this now, is that > the current enum proposal is based on objects, and I consider it somewhat > important that enum values can also work as array keys. > > From a technical perspective, this also lays the groundwork for supporting > other key types in the future, e.g. if we wish to switch PHP to use > arbitrary-precision integers. > > Regards, > Nikita > +1 for the feature itself, really nice! It makes the ENUM feature more complete. The implementation aspects I can't judge though. r//Björn L