php-src
php-src copied to clipboard
ReflectionEnum::isInstantiable() returns true
Description
The following code:
<?php
enum A {
case B;
}
$e = new ReflectionEnum(A::class);
var_dump($e->isInstantiable());
Resulted in this output:
bool(true)
But I expected this output instead:
bool(false)
Enums (as of 8.1) are never instantiable, so isInstantiable() should always return false.
PHP Version
8.1.1
Operating System
No response
Also bug 81681 and 8.1.2.