Skip to content

Commit b15113a

Browse files
committed
fix isInnerClass
1 parent 1126520 commit b15113a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ext/reflection/php_reflection.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4079,16 +4079,12 @@ static void add_class_vars(zend_class_entry *ce, bool statics, zval *return_valu
40794079
ZEND_METHOD(ReflectionClass, isInnerClass)
40804080
{
40814081
reflection_object *intern;
4082-
zend_class_entry *ce;
4083-
4084-
ZEND_PARSE_PARAMETERS_NONE();
4085-
4086-
GET_REFLECTION_OBJECT_PTR(ce);
4082+
zend_class_entry *ce;
4083+
ZEND_PARSE_PARAMETERS_NONE();
40874084

4088-
// If the class is an inner class, it will have a T_INNER_REF in its name
4089-
// todo: make this better?
4085+
GET_REFLECTION_OBJECT_PTR(ce);
40904086

4091-
RETURN_BOOL(strstr(ZSTR_VAL(ce->name), ":>") != NULL);
4087+
RETURN_BOOL(ce->lexical_scope && ce->lexical_scope->type != ZEND_NAMESPACE_CLASS);
40924088
}
40934089
/* }}} */
40944090

0 commit comments

Comments
 (0)