Skip to content

Instantly share code, notes, and snippets.

@dstogov
Created December 9, 2019 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstogov/0321d27b7970692484a4de6ad5089273 to your computer and use it in GitHub Desktop.
Save dstogov/0321d27b7970692484a4de6ad5089273 to your computer and use it in GitHub Desktop.
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index d669ff6da2..f36e44148f 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4581,6 +4581,11 @@ ZEND_METHOD(reflection_class, getModifiers)
}
GET_REFLECTION_OBJECT_PTR(ce);
+ if (ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
+ /* Don't keep "implicit" flag if not necessary */
+ keep_flags &= ~ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
+ }
+
RETURN_LONG((ce->ce_flags & keep_flags));
}
/* }}} */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment