We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
__clone()
1 parent efeef55 commit 452f08aCopy full SHA for 452f08a
Zend/zend_objects.c
@@ -270,6 +270,14 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members_with(zend_object *new_obj
270
}
271
272
if (EXPECTED(!EG(exception)) && zend_hash_num_elements(properties) > 0) {
273
+ /* Unlock readonly properties once more. */
274
+ if (ZEND_CLASS_HAS_READONLY_PROPS(new_object->ce) && old_object->ce->clone) {
275
+ for (uint32_t i = 0; i < new_object->ce->default_properties_count; i++) {
276
+ zval* prop = OBJ_PROP_NUM(new_object, i);
277
+ Z_PROP_FLAG_P(prop) |= IS_PROP_REINITABLE;
278
+ }
279
280
+
281
const zend_class_entry *old_scope = EG(fake_scope);
282
283
EG(fake_scope) = scope;
0 commit comments