Skip to content

Commit eea1779

Browse files
committed
Remove object copy which is not need anymore
1 parent e77225e commit eea1779

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/reflection/php_reflection.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,10 +1429,9 @@ static void reflection_type_factory(
14291429
intern->ptr = reference;
14301430
intern->ref_type = REF_TYPE_TYPE;
14311431
intern->ce = object_ce;
1432+
ZVAL_UNDEF(&intern->obj);
14321433

14331434
if (closure_object) {
1434-
ZVAL_OBJ_COPY(&intern->obj, closure_object);
1435-
14361435
zend_function *fptr = NULL;
14371436
zend_class_entry *called_scope = NULL;
14381437
zend_object *this_obj = NULL;
@@ -1444,8 +1443,6 @@ static void reflection_type_factory(
14441443
} else {
14451444
intern->ce = fptr->common.scope;
14461445
}
1447-
} else {
1448-
ZVAL_UNDEF(&intern->obj);
14491446
}
14501447

14511448
/* Property types may be resolved during the lifetime of the ReflectionType.
@@ -3161,7 +3158,6 @@ ZEND_METHOD(ReflectionRelativeClassType, resolveToNamedType)
31613158

31623159
/* Unbound closures can have relative class types that we cannot resolve */
31633160
if (!intern->ce) {
3164-
ZEND_ASSERT(!Z_ISUNDEF(intern->obj));
31653161
zend_throw_exception_ex(reflection_exception_ptr, 0,
31663162
"Cannot resolve relative class name for a static closure");
31673163
RETURN_THROWS();

0 commit comments

Comments
 (0)