Hi,

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.

https://wiki.php.net/rfc/enumerations

I tried to answer the following question but failed to do so:

What is the scalar value for a ScalarEnum if none is explicitly defined?

The RFC makes this example:
> enum Suit: string implements Colorful {
>    case Hearts = 'H';
>    case Diamonds = 'D';
…
> 'D' == Suit::Diamonds->value; // true


What in this case?

> enum Suit: string {
>    case Hearts;
>    case Diamonds;
…

What is the outcome of `Suit::Diamonds->value` ?

Thanks!
- Markus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to