summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/reflection/php_reflection.c3
-rw-r--r--ext/reflection/tests/bug78895.phpt38
2 files changed, 40 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 4b3851e9e0..6c04c47ea0 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4667,7 +4667,7 @@ ZEND_METHOD(reflection_class, getModifiers)
reflection_object *intern;
zend_class_entry *ce;
uint32_t keep_flags = ZEND_ACC_FINAL
- | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
+ | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -6699,6 +6699,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
zend_class_implements(reflection_class_ptr, 1, reflector_ptr);
zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
+ /* IS_IMPLICIT_ABSTRACT is not longer used */
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS);
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_EXPLICIT_ABSTRACT", ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_FINAL", ZEND_ACC_FINAL);
diff --git a/ext/reflection/tests/bug78895.phpt b/ext/reflection/tests/bug78895.phpt
new file mode 100644
index 0000000000..7e616c4456
--- /dev/null
+++ b/ext/reflection/tests/bug78895.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Fixed bug #78895 (Reflection detects abstract non-static class as abstract static).
+--FILE--
+<?php
+abstract class Foo {
+ abstract public function f1();
+}
+interface I {
+ public function f2();
+}
+trait T {
+ abstract public function f2();
+}
+class Bar extends Foo implements I {
+ use T;
+ function f1() {}
+ function f2() {}
+}
+$ref = new ReflectionClass(Foo::class);
+var_dump(Reflection::getModifierNames($ref->getModifiers()));
+$ref = new ReflectionClass(I::class);
+var_dump(Reflection::getModifierNames($ref->getModifiers()));
+$ref = new ReflectionClass(T::class);
+var_dump(Reflection::getModifierNames($ref->getModifiers()));
+$ref = new ReflectionClass(Bar::class);
+var_dump(Reflection::getModifierNames($ref->getModifiers()));
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ string(8) "abstract"
+}
+array(0) {
+}
+array(0) {
+}
+array(0) {
+} \ No newline at end of file