mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
When Reflection internally instantiates a ReflectionClass, it should create a more specific ReflectionEnum instance if the class is actually an enum.
27 lines
464 B
PHP
27 lines
464 B
PHP
--TEST--
|
|
Bug #81457: Enum ReflectionMethod->getDeclaringClass() return a ReflectionClass
|
|
--FILE--
|
|
<?php
|
|
|
|
enum testEnum {
|
|
case A;
|
|
case B;
|
|
|
|
public function foo () {}
|
|
}
|
|
|
|
$re = new ReflectionEnum(testEnum::class);
|
|
$me = $re->getMethod('foo');
|
|
|
|
echo $me->getDeclaringClass()::class, "\n";
|
|
|
|
$rc = new ReflectionClass(testEnum::class);
|
|
$mc = $re->getMethod('foo');
|
|
|
|
echo $mc->getDeclaringClass()::class, "\n";
|
|
|
|
?>
|
|
--EXPECT--
|
|
ReflectionEnum
|
|
ReflectionEnum
|