> Le 31 janv. 2023 à 22:01, Máté Kocsis <kocsismat...@gmail.com> a écrit :
> 
> 
> Please find the updated RFC here:
> https://wiki.php.net/rfc/typed_class_constants.
> 
> Regards,
> Máté


Hi,

The RFC states that it is technically not possible to have a constant of 
effective type `static` or `self`. While this is probably correct for regular 
classes, this is not true for enums. The following code ostensibly works 
(https://3v4l.org/84W92):

```php
enum qux {
    const foo_alias = self::foo;
    case foo;
}

var_dump(qux::foo_alias); // enum(qux::foo)
```

I think that `self` should be allowed here, because it is meaningful.

—Claude

Reply via email to