1--TEST--
2ReflectionEnum::__construct()
3--FILE--
4<?php
5
6enum Foo {}
7class Bar {}
8
9echo (new ReflectionEnum(Foo::class))->getName() . "\n";
10
11try {
12    new ReflectionEnum('Bar');
13} catch (\Exception $e) {
14    echo $e->getMessage() . "\n";
15}
16
17try {
18    new ReflectionEnum('Baz');
19} catch (\Exception $e) {
20    echo $e->getMessage() . "\n";
21}
22
23try {
24    new ReflectionEnum([]);
25} catch (Error $e) {
26    echo $e->getMessage() . "\n";
27}
28
29?>
30--EXPECT--
31Foo
32Class "Bar" is not an enum
33Class "Baz" does not exist
34ReflectionEnum::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given
35