Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120111 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55443 invoked from network); 23 Apr 2023 17:53:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Apr 2023 17:53:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0BA61180382 for ; Sun, 23 Apr 2023 10:53:44 -0700 (PDT) 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 23 Apr 2023 10:53:43 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-2f4214b430aso2106040f8f.0 for ; Sun, 23 Apr 2023 10:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682272422; x=1684864422; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=SsaZyDgVwcZKVoouiTJ/bmhGdry52qlrgumf3MTb9J0=; b=m9XAbC0l4pRN3k6nLM/HCmefKHb/p1n/zuF0dwb2Et3jraov1AAgGaA46kLVBsxZRH bWgeOL8TbXSumSz+40NzZCBxF9ROE/zrnly5Dx0JYeFXPA8r6SG/DrzFZ2cUVxOtJFBO +qEthrdkCCyuiHvAxGDFdruCMqY+OmilvojyyNai4VLThZVWEAPvew0JZUD95cHpvavL IJOvHvvSJpci9h5ah9I4lyGNOdtgW4mhdohr9N0Vdl3xf8bf4aOxNlmpa2CqZXTg40N1 IkTmoHiTUlUX+UnPz3cNhnHbCYHW1jJOG6IG/rn2hCp5U4eD9/a7qUkoYi/SyToId21R 5t+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682272422; x=1684864422; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=SsaZyDgVwcZKVoouiTJ/bmhGdry52qlrgumf3MTb9J0=; b=jDcHkDrXVQE62hqDq2sIQbxj3hXowEAy+1jLTo6PZZlT8odMw9bEB3PYYYxoDZRrs8 nInzeGk9V7eyShw5K0BNhljdgDaiVPGMr/UgnbpaYYMYTkWAAV9s9bILoj6peLT7ZTbh ROh2SMRjpi79KTZxkRF9Adq0AhRL2JfSTYFdOUOLTyRhAJpiUWOLkPeYD1HoI8wQQlQj jnELTCnM/M+mWp1Xq6YGrkKLshvUt+N19ZfGWwG3QR/hM7/JyUJoK+MKnhjrcCitBk8C FPqo71+OfoJpQRwaqgw6bcsrLoKuHyQlvF5bWYoIHb6rJb3p2X73ncrM0zK/Q1CwmN/n Xu1g== X-Gm-Message-State: AAQBX9dfNEz12lutqKOg+qL3HR2hZ6+yRuTWEwzDUHVkzMu6qG8PzNU5 gzOOrzpG2Os4VJAz9FbATACxreblWJ4= X-Google-Smtp-Source: AKy350Y08NlWi44JNNKlSY7Hfi9k+cCvANN43YowJ6RH6xMmCAYjBICyx6ab6I+OVgW18bfQF7IkyA== X-Received: by 2002:adf:d84d:0:b0:2d8:47c7:7b50 with SMTP id k13-20020adfd84d000000b002d847c77b50mr7752954wrl.1.1682272421609; Sun, 23 Apr 2023 10:53:41 -0700 (PDT) Received: from [192.168.0.22] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.googlemail.com with ESMTPSA id n3-20020a05600c294300b003f182c11667sm10129696wmd.39.2023.04.23.10.53.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Apr 2023 10:53:41 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------qS1LWwdsGvXMLfNvt0VBm0rx" Message-ID: <3e131a9b-9f5e-5eb0-33e4-a3a03327e157@gmail.com> Date: Sun, 23 Apr 2023 18:53:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-GB To: internals@lists.php.net References: In-Reply-To: Subject: Re: [PHP-DEV] Introduction - SuitespaceRnD From: rowan.collins@gmail.com (Rowan Tommins) --------------qS1LWwdsGvXMLfNvt0VBm0rx Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/04/2023 16:11, Garet Claborn wrote: > Specifically I finally registered > as I have written up an RFC in response to this issue thread > on GitHub. Welcome, and in case you haven't found it already, here's the guide to the RFC process: https://wiki.php.net/rfc/howto I'll wait with interest to see the RFC, but would note two things: - If the aim is to allow array keys to be enum cases themselves (or objects in general), you'll likely need at least a partial implementation before taking it to a vote, as the impact on the rest of the engine, in terms of performance and complexity, will be a major deciding factor. You can still draft the RFC beforehand to judge the interest, however. - If the aim is to automatically cast the enum cases to ordinary strings or ints, expect some scepticism. I for one believe that it is an essential property of enums that Day::Monday == Month::January should be false, and it follows that array_key_exists(Day::Monday, [Month::January => true]) should be false as well. On 23/04/2023 17:01, Robert Landers wrote: > Even if it > has to be something 'ugly' to keep people from using that itself as a > value (similar to how js symbol types work -- a one-way cast). As far as I understand, Symbols in JS are entirely their own type, and the definition of objects directly allows property keys to be either a String or a Symbol; so it is equivalent to PHP allowing enum cases, but not other objects, to be array keys. > Properties are identified using key values. A property key value is either an ECMAScript String value or a Symbol value. All String and Symbol values, including the empty String, are valid as property keys. https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-object-type Regards, -- Rowan Tommins [IMSoP] --------------qS1LWwdsGvXMLfNvt0VBm0rx--