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 718d5e5 commit 9db5b32Copy full SHA for 9db5b32
Zend/zend_objects.c
@@ -294,6 +294,14 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members_ex(zend_object *new_objec
294
}
295
296
if (EXPECTED(!EG(exception)) && zend_hash_num_elements(properties) > 0) {
297
+ /* Unlock readonly properties once more. */
298
+ if (ZEND_CLASS_HAS_READONLY_PROPS(new_object->ce) && old_object->ce->clone) {
299
+ for (uint32_t i = 0; i < new_object->ce->default_properties_count; i++) {
300
+ zval* prop = OBJ_PROP_NUM(new_object, i);
301
+ Z_PROP_FLAG_P(prop) |= IS_PROP_REINITABLE;
302
+ }
303
304
+
305
zend_class_entry *old_scope = EG(fake_scope);
306
307
EG(fake_scope) = scope;
0 commit comments