Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112842 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46535 invoked from network); 11 Jan 2021 14:51:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Jan 2021 14:51:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 49F671804E2 for ; Mon, 11 Jan 2021 06:29:04 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 11 Jan 2021 06:29:03 -0800 (PST) Received: by mail-lf1-f44.google.com with SMTP id o13so38054437lfr.3 for ; Mon, 11 Jan 2021 06:29:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=1hieyS9d/IbfyvdcMA0vmRAH7YW3GEtxgOyQkoxTOmA=; b=ISPdpS5zgfV9XfMB5S7+BE52WDz2dfNRCYMp49J8czV2a2XYunylRGsScoiyu3dN6c cAQoZiycqUVBQ3ojAoWwGyn2Z0Uqw0W/lL/P2qiUco4kc4K5R5QeAQ/PaTharK2fpHiT d5APaC8rBlxyBxz9eIqbVfJQrCRwP1nIMZQHPUFB0zcy9wLVquYcL2YtMpTrj0tJfeWO 5JLL4PyCCvvKTXCROgr7yyjobJqRByWMEjSKizZh0rKFF3vZ/pIU0cUx6xTOdz/AIaDI Xf0CG6H4Ipds/X70qXuwmMKVz/GW39owvUdSFyuV/VVWs8JP2E4wNEsOGUEy1KVXdzM5 uJMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=1hieyS9d/IbfyvdcMA0vmRAH7YW3GEtxgOyQkoxTOmA=; b=EB8QAmOP7dMNk+Es6iImkKqhNyCoHoJgCrEXhtlSYBDweJ3WZSKyCvHg/KtpSiOhNd C10ALGADo6H+8YwQw5Y4Fu5gJj6WNtAUpVDytQS0xS9mnc02Wc0fg17jSX8nprdijChf NnSWw1EgLi1SZ6GGA0RprS0wka7TDyUhRzqYjkJIvMHHYE5iU4HQkl17MbWZZ/w61wz2 RRHKzXHO6q1WGh+KiSCa9334XmcYA+LF7eXKCJuX5F6yXLd3w6gc0HpGBE3vXOGLK5R5 VnEAguaaUFjcbqU8CGXXVv9lPA/L8Zf6PwqesBk2tvWS/54eDXdh0K0rh/e1yxRRLIPX dNTA== X-Gm-Message-State: AOAM530AwEr9+GbukEEINIIHQc/P+JhLEFBovL26A9lM9nBRGR3WPILv rft3ptIEUSq0pWGjuo5cnlQmRAZHltnNlTBZnSGcZRJtTK0pOA== X-Google-Smtp-Source: ABdhPJzkIHl/pdnbBj2HpjhW5Lm7NGTJh1UFmjaotwgwg95OyYr1czrYnmAz1ks9tJflD+K21A6ykVN5LmqwxN4C8fc= X-Received: by 2002:ac2:4431:: with SMTP id w17mr6715952lfl.223.1610375341866; Mon, 11 Jan 2021 06:29:01 -0800 (PST) MIME-Version: 1.0 Date: Mon, 11 Jan 2021 15:28:46 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000003501c005b8a0ba70" Subject: [RFC] Allow object keys in arrays From: nikita.ppv@gmail.com (Nikita Popov) --0000000000003501c005b8a0ba70 Content-Type: text/plain; charset="UTF-8" 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 --0000000000003501c005b8a0ba70--