From 791aa39a2ce42f66a183f235e69181c8ca895b2b Mon Sep 17 00:00:00 2001 From: sasezaki Date: Sat, 2 Oct 2021 17:50:08 +0900 Subject: [PATCH] Fix bug #81474: Make ReflectionAttribute non-final --- ext/reflection/php_reflection.c | 1 - ext/reflection/php_reflection.stub.php | 2 +- ext/reflection/php_reflection_arginfo.h | 2 +- ext/reflection/tests/ReflectionAttribute_final.phpt | 10 ---------- 4 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 ext/reflection/tests/ReflectionAttribute_final.phpt diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index dd447d4174041..f9b888f1c166b 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6618,7 +6618,6 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ INIT_CLASS_ENTRY(_reflection_entry, "ReflectionAttribute", class_ReflectionAttribute_methods); reflection_init_class_handlers(&_reflection_entry); - _reflection_entry.ce_flags |= ZEND_ACC_FINAL; reflection_attribute_ptr = zend_register_internal_class(&_reflection_entry); REGISTER_REFLECTION_CLASS_CONST_LONG(attribute, "IS_INSTANCEOF", REFLECTION_ATTRIBUTE_IS_INSTANCEOF); diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index d12d10bd81d39..b0bfade520f10 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -653,7 +653,7 @@ private function __clone(): void {} private function __construct() {} } -final class ReflectionAttribute +class ReflectionAttribute { public function getName(): string {} public function getTarget(): int {} diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index ba524b4f6d242..6fdc0c44d22ee 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6849bff1f2b343df4bd7e6da9c8adc555731e2d3 */ + * Stub hash: 6e98777552147f4a413db16ecd87c9a6931f9c00 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0) diff --git a/ext/reflection/tests/ReflectionAttribute_final.phpt b/ext/reflection/tests/ReflectionAttribute_final.phpt deleted file mode 100644 index f2899d9724a56..0000000000000 --- a/ext/reflection/tests/ReflectionAttribute_final.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Check that ReflectionAttribute is final ---FILE-- - ---EXPECTF-- -Fatal error: Class T may not inherit from final class (ReflectionAttribute) in %s on line %d