Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118103 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76972 invoked from network); 27 Jun 2022 06:25:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2022 06:25:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D037F180211 for ; Mon, 27 Jun 2022 01:16:19 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 ; Mon, 27 Jun 2022 01:16:19 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id 189so4421133wmz.2 for ; Mon, 27 Jun 2022 01:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=t5CG2LKe3wUDyzIWbCSrEsHuLiW8QhWGejaqsZJEyvY=; b=EOngHVpNS9E2c0rLR+DeDIvTVldvzaheYCjZ2OvtciS33SOD9ynEEzdFvB7F5jdY22 M/o1I14Babyya24JryPjaonG9Qn3pJArbfjb1vKF9IojcVPW+bFfiqdJRGPWfFx0pixE 5dTIXZp++qXPUBxgtXV2nZEZ1D5LGE4ONUSwsdOevJTm2BeMQmQ0brJUbIBwF1vjeLU/ hdk3A6+1zwtwGjKjdiW17jr0MqGSEnY7egjJaVyyALKN8AMysMgKNfMKCj+zjxOsa+ER 078UPLzxcspvMX8subINUK4lijoTzyz6zNL8KX5mETEFXIqh1tbY5NfTrQJg1ZAvMpNx Cn/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=t5CG2LKe3wUDyzIWbCSrEsHuLiW8QhWGejaqsZJEyvY=; b=oDrSRRCHgnnbFcCKRnMHlLnMjQsxn9FlIh/gwH+82oPR9tJFTHgLvIOaWxHm9G1lpH /g6PPdN+dq565eiZnmp0NvJNR0q0Vv4fNuA+KTsFzngDPDZ7z9S8k2QC/1M2MAELD0oq VcJ/2KZnoX7tw4qksf1pvOkJ4Nu/ZtHKc99a+dkEPeTNJ8FKTswzv0O2g5beQaY8A3i9 9hUtuzc3ic815vAvvBvnXOa4sqF1wTZTTNs5UZapp4UebjzmFTKB8cB2RT6ZsYS/PvKP yfNWRnwP9T3cPqiebWigzE8alxAf3OO9lZopgvRKAxlm3PjOFQukLSLTptsiF+6z317d JKbQ== X-Gm-Message-State: AJIora+foSVpJLV/USgri98xrPlKZc19G84/+Vy5Hz022/8edfn4D71C Z39IWO+JPBCcwnc4olAxyK7YxA+0r/Y= X-Google-Smtp-Source: AGRyM1uIPMFIPkMOoADOcqbeFE5tkQ2CNLNqyvhKle7oMKbMeglAqpNcS2eXqcOdfkbvwzDEbi6/xA== X-Received: by 2002:a05:600c:1e8a:b0:3a0:2aff:7d7e with SMTP id be10-20020a05600c1e8a00b003a02aff7d7emr13457789wmb.95.1656317778188; Mon, 27 Jun 2022 01:16:18 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id s5-20020a5d5105000000b0021b88ec99cesm9619164wrt.94.2022.06.27.01.16.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 01:16:17 -0700 (PDT) Message-ID: Date: Mon, 27 Jun 2022 09:16:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-GB To: internals@lists.php.net References: <6a016333-2be0-4865-b263-29611ecb4c62@www.fastmail.com> <78f26b4d-6f3e-f5e0-3ad5-3a2378ee7030@mabe.berlin> In-Reply-To: <78f26b4d-6f3e-f5e0-3ad5-3a2378ee7030@mabe.berlin> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions From: rowan.collins@gmail.com (Rowan Tommins) On 27/06/2022 08:38, Marc Bennewitz wrote: > Now as I have a lot of such classes and I want to make sure all of the > prefixes are unique so I added an enum with all prefixes and use the > enum value as constant value as well. > > enum IdPrefix:string > { >     case USER_ID = 'u-'; >     // ... > } This would never have occurred to me as a design, because I had no idea that the values of backed enums were enforced to be unique. I'm not sure if it can be considered "taking advantage of a side-effect", or if people always expected backed enums to be used that way. Ultimately, that's my reaction to both the enum-related RFC currently under discussion: I don't really understand what backed enums are intended for in the first place, so find it hard to judge whether expanding them in a particular way makes sense. If a string-backed enum can be considered just a unique set of strings, then it really has very little in common with how I think of (unbacked) enums, but maybe that's fine. Regards, -- Rowan Tommins [IMSoP]