File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -270,22 +270,28 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members_with(zend_object *new_obj
270270 }
271271
272272 if (EXPECTED (!EG (exception )) && zend_hash_num_elements (properties ) > 0 ) {
273+ const zend_class_entry * old_scope = EG (fake_scope );
274+
275+ EG (fake_scope ) = scope ;
276+
273277 zend_ulong num_key ;
274278 zend_string * key ;
275279 zval * val ;
276280 ZEND_HASH_FOREACH_KEY_VAL (properties , num_key , key , val ) {
277281 if (UNEXPECTED (key == NULL )) {
278282 key = zend_long_to_str (num_key );
279- zend_update_property_ex ( scope , new_object , key , val );
283+ new_object -> handlers -> write_property ( new_object , key , val , NULL );
280284 zend_string_release_ex (key , false);
281285 } else {
282- zend_update_property_ex ( scope , new_object , key , val );
286+ new_object -> handlers -> write_property ( new_object , key , val , NULL );
283287 }
284288
285289 if (UNEXPECTED (EG (exception ))) {
286290 break ;
287291 }
288292 } ZEND_HASH_FOREACH_END ();
293+
294+ EG (fake_scope ) = old_scope ;
289295 }
290296
291297
You can’t perform that action at this time.
0 commit comments