Skip to content

Commit 3f275c4

Browse files
committed
Remove object copy which is not need anymore
1 parent c0a2da3 commit 3f275c4

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
@@ -1458,10 +1458,9 @@ static void reflection_type_factory(
14581458
intern->ptr = reference;
14591459
intern->ref_type = REF_TYPE_TYPE;
14601460
intern->ce = object_ce;
1461+
ZVAL_UNDEF(&intern->obj);
14611462

14621463
if (closure_object) {
1463-
ZVAL_OBJ_COPY(&intern->obj, closure_object);
1464-
14651464
zend_function *fptr = NULL;
14661465
zend_class_entry *called_scope = NULL;
14671466
zend_object *this_obj = NULL;
@@ -1473,8 +1472,6 @@ static void reflection_type_factory(
14731472
} else {
14741473
intern->ce = fptr->common.scope;
14751474
}
1476-
} else {
1477-
ZVAL_UNDEF(&intern->obj);
14781475
}
14791476

14801477
/* Property types may be resolved during the lifetime of the ReflectionType.
@@ -3190,7 +3187,6 @@ ZEND_METHOD(ReflectionRelativeClassType, resolveToNamedType)
31903187

31913188
/* Unbound closures can have relative class types that we cannot resolve */
31923189
if (!intern->ce) {
3193-
ZEND_ASSERT(!Z_ISUNDEF(intern->obj));
31943190
zend_throw_exception_ex(reflection_exception_ptr, 0,
31953191
"Cannot resolve relative class name for a static closure");
31963192
RETURN_THROWS();

0 commit comments

Comments
 (0)