1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/reflection/tests/bug81457.phpt
Nikita Popov ea11e79a43 Fixed bug #81457
When Reflection internally instantiates a ReflectionClass, it
should create a more specific ReflectionEnum instance if the
class is actually an enum.
2021-09-20 15:29:30 +02:00

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