xref: /PHP-8.2/ext/reflection/tests/bug81457.phpt (revision ea11e79a)
1--TEST--
2Bug #81457: Enum ReflectionMethod->getDeclaringClass() return a ReflectionClass
3--FILE--
4<?php
5
6enum testEnum {
7    case A;
8    case B;
9
10    public function foo () {}
11}
12
13$re = new ReflectionEnum(testEnum::class);
14$me = $re->getMethod('foo');
15
16echo $me->getDeclaringClass()::class, "\n";
17
18$rc = new ReflectionClass(testEnum::class);
19$mc = $re->getMethod('foo');
20
21echo $mc->getDeclaringClass()::class, "\n";
22
23?>
24--EXPECT--
25ReflectionEnum
26ReflectionEnum
27