Skip to content

Commit 870d460

Browse files
committed
fixup! zend_objects: Add clone_obj_with object handler
1 parent e77345d commit 870d460

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Zend/zend_objects.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,13 @@ ZEND_API zend_object *zend_objects_clone_obj_with(zend_object *old_object, zend_
356356
zend_throw_error(NULL, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(old_object->ce->name));
357357
return NULL;
358358
}
359+
359360
if (zend_hash_num_elements(properties) > 0) {
360361
zend_throw_error(NULL, "Cloning objects of class %s with updated properties is not supported", ZSTR_VAL(old_object->ce->name));
361362
return NULL;
362-
} else {
363-
return old_object->handlers->clone_obj(old_object);
364363
}
364+
365+
return old_object->handlers->clone_obj(old_object);
365366
}
366367

367368
if (UNEXPECTED(zend_object_is_lazy(old_object))) {

0 commit comments

Comments
 (0)