Re: [RFC] Enumerations, Round 2

From: Date: Wed, 30 Dec 2020 11:00:12 +0000
Subject: Re: [RFC] Enumerations, Round 2
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-112657@lists.php.net to get a copy of this message
On 30 December 2020 08:43:33 GMT+00:00, Markus Fischer <markus@fischer.name> wrote: >What is the scalar value for a ScalarEnum if none is explicitly >defined? The question has no answer, because the declaration of the enum itself would be invalid: > If an enumeration is marked as having a scalar equivalent, then all cases must have a unique > scalar equivalent defined explicitly. enum Suit: string { case Hearts; case Diamonds; } Presumably, this would result in an Error being thrown when compiling the declaration. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#112657) next »