[php-src] Issue #8583: ReflectionClass::isInstantiable() returns true for enums in PHP8.1
| From: | CxDevLead | Date: | Thu, 19 May 2022 23:22:35 +0000 |
| Subject: | [php-src] Issue #8583: ReflectionClass::isInstantiable() returns true for enums in PHP8.1 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241544@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8583
Author: CxDevLead
### Description
The following code:
````
enum Subdomain: int
{
case Test = 0;
}
$reflectionClass = new ReflectionClass(Subdomain::class);
var_dump($subdomain, $reflectionClass->isInstantiable(), $reflectionClass->isEnum());
```
Resulted in this output:
```
enum(Subdomain::Test) bool(true) bool(true)
```
But I expected this output instead:
```
enum(Subdomain::Test) bool(false) bool(true)
```
### PHP Version
PHP 8.1.1
### Operating System
Mac 12.4