Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120110 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49766 invoked from network); 23 Apr 2023 16:01:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Apr 2023 16:01:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ADF781804AA for ; Sun, 23 Apr 2023 09:01:29 -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, 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-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 09:01:29 -0700 (PDT) Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-38bc978ac3eso1126001b6e.1 for ; Sun, 23 Apr 2023 09:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682265688; x=1684857688; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/UE5lXEUDxE8iXhSzaZdDtrlbxig6iw3+/6TGZf1GJI=; b=nMCAaAH4BTjI2LgYMnvGzHx5Q2qx+PN1Hp23wSsYja2MBZDiO+astBjPpjtmtl5K28 stPDh0a6bs8rPJzPgRo8J7dL3BDHJk12NNf18ydLq+wEhV2Uq/4UPVGA3Fy8pHr8G4Z4 tb/f4qztbudtziAbej4xp0G7lF80th+QmymvU7+N1VOuxaQJYOhb0kl2aIgntfjfMrce QaJCkvNOxlUPKx7bn9hXM+CFJVAtmmfXHVucZBZUJs1Yl9qeZbQVi3Mjo1TuC1SLLC4I 0lMOo8zpk+j27bnd/gFkdBzWoqaAeyg3bEVN7GvQqhX8xqtbmh/JM2kFwC/obVR8AVw5 5FCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682265688; x=1684857688; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/UE5lXEUDxE8iXhSzaZdDtrlbxig6iw3+/6TGZf1GJI=; b=Q4mMwshuFBbTu6qoc1e0M1v7mxFeYC894sfMXJXQtEf08oPbGC7jsa1sSSACRw9L1e 2VRnq9s4OUvPLT3w9oroKfmEb5MLm7aAIVgXygy6APdn++2VOm2495G3tV3cKhG9Nv5v 9h4jf17sD/oOi/JScmP8AughDp5Mu1S4pnJHET/LeziB60+6WuLsGWsWpQfTR29iTW+P 6ih7em1g8nVjnDaoshoCSL2zg4RZBzi+XLqUVAw0ammwGtdO0Re+LaDXMsGDCckOMJJn rrjCsAO0OFw/FPZfyxWFhGik0siA6JDOHeOKveN8kd4ivC6d50vNJcAU7p/2Z8jic3Ch 77YQ== X-Gm-Message-State: AAQBX9fryVKwqzUKaFCk5Do5n7xHuJo/vhIMJkXB25LPtggZhaYKnYXs nPL5348eUPD7Qr+kLfbP64e3lwyONqh++hEfkKplvqq6ivzMog== X-Google-Smtp-Source: AKy350a0MDRVxkuFAAEIOOCzCE2uPc+t/b84GgAtrhF800Ik9WT2FxvXLr/YWYdnP0TvsKM1QcTKEiRCE9KsbbEFmIk= X-Received: by 2002:a05:6808:14c7:b0:38c:6d8:b78e with SMTP id f7-20020a05680814c700b0038c06d8b78emr6887440oiw.40.1682265688226; Sun, 23 Apr 2023 09:01:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 23 Apr 2023 18:01:16 +0200 Message-ID: To: Lokrain Cc: Niels Dossche , Garet Claborn , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Introduction - SuitespaceRnD From: landers.robert@gmail.com (Robert Landers) On Sun, Apr 23, 2023 at 1:57=E2=80=AFPM Lokrain wrote: > > Hello, > > For me, this is just a wrong way of using enums for the sake of opinionat= ed > solution of specific problem. > > Regards, > Dimitar > > On Sun, 23 Apr 2023 at 14:23, Niels Dossche wro= te: > > > Hi > > > > On 4/19/23 17:11, Garet Claborn wrote: > > > Hello PHP Internals, > > > > > > I am Garet Claborn, CTO for Suitespace Inc > > > , leading > > > up our R&D team. Just registered and my PHP Wiki username is: > > > *suitespacernd* > > > > > > We use PHP extensively in our projects. Specifically I finally regist= ered > > > as I have written up an RFC in response to this issue thread > > > on GitHub. While I am > > notably > > > attached to said issue, I hope to provide useful feedback in general = from > > > our case studies. > > > > > > Feel free to reach out for whatever reason. > > > > > > Cheers, > > > Garet Claborn > > > > > > CTO, Suitespace Inc > > > garet@suiteux.com > > > > > > > Good luck with the RFC, I'm also quite interested in this feature so I'= m > > interested to see where it goes. > > You might also want to explicitly ask for RFC karma so that you can cre= ate > > a wiki page for the RFC, if you haven't done that already :) > > > > Kind regards > > Niels > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: https://www.php.net/unsub.php > > > > > For me, this is just a wrong way of using enums for the sake of opinionat= ed > solution of specific problem. That seems a bit of a strong reaction, though I agree that this can be solved fairly easily in user-land: trait ArrayKey { public function key(): string { return get_class($this) . '::' . $this->name; } } enum T { use ArrayKey; case A; case B; } echo T::A->key(); // outputs: T::A or even set it up in the constructor. If you don't have control over the enums, you can write a simple function to the same. As a side-note, I would rather have enums able to be casted to a string than to change how arrays work. 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).