Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112665 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56765 invoked from network); 30 Dec 2020 16:33:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Dec 2020 16:33:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 337531804CF for ; Wed, 30 Dec 2020 08:07:58 -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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (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 ; Wed, 30 Dec 2020 08:07:57 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 48B9AB06 for ; Wed, 30 Dec 2020 11:07:56 -0500 (EST) Received: from imap26 ([10.202.2.76]) by compute4.internal (MEProxy); Wed, 30 Dec 2020 11:07:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=v+3bqtGp4+LoMs8TGUTQ97x4M01cfLNyHtWr0zf8v b0=; b=cgeT1GU9xt2e+XvbeOJru4AoPWbd1U+MzRr8EcvLc3t/2Qt/i66KK5Gt8 DpGpnjDjzyWUq5K+Uz2d8xwJrHfWxRreSOwxy41zshcKXR+9KmBK3Kk2bV+Z1qTr ueWszi28/ZQ1BX3vNIYeO6n7RfT/jTFgw7LFNjQYoSjPJ875KPFQS1vlbauqIZby JetXibaxDNhvV/iJGrhwcOLpylHBpl7CFrPQKx+MKl6eE/r5HyPXGxTk/wVTI3ll hiCE6UnxBkSzyyAVwUT35L9ukOKLpiiP2+LYQ/ePA/3iCsCj5PZuBlgD0jgzAJB2 NIcjPX0/Z45DZudNWXhbAk2wGmelA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddvfedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepgeeghefgteejheeggfeghfelueeggfdtjeeivedv tefhveeguedufeelhedvteeinecuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhf ihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6860C14200A2; Wed, 30 Dec 2020 11:07:55 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.1-61-gb52c239-fm-20201210.001-gb52c2396 Mime-Version: 1.0 Message-ID: <763ab2c5-8362-4f1c-9733-6f86cde58265@www.fastmail.com> In-Reply-To: <856d4f8d-e901-ba76-e421-303b7a7bc05e@fischer.name> References: <856d4f8d-e901-ba76-e421-303b7a7bc05e@fischer.name> Date: Wed, 30 Dec 2020 10:07:34 -0600 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Enumerations, Round 2 From: larry@garfieldtech.com ("Larry Garfield") On Wed, Dec 30, 2020, at 2:43 AM, Markus Fischer wrote: > Hi, >=20 > On 28.12.20 21:21, Larry Garfield wrote: > > The full RFC is here, and I recommend reading it again in full given= how much was updated. > >=20 > > https://wiki.php.net/rfc/enumerations >=20 > I tried to answer the following question but failed to do so: >=20 > What is the scalar value for a ScalarEnum if none is explicitly define= d? >=20 > The RFC makes this example: > > enum Suit: string implements Colorful { > > case Hearts =3D 'H'; > > case Diamonds =3D 'D'; > =E2=80=A6 > > 'D' =3D=3D Suit::Diamonds->value; // true >=20 >=20 > What in this case? >=20 > > enum Suit: string { > > case Hearts; > > case Diamonds; > =E2=80=A6 >=20 > What is the outcome of `Suit::Diamonds->value` ? A parse error on the declaration; if it's a scalar enum, explicit values= are required for all cases. --Larry Garfield