- getObject(http_message_object, obj);
- return http_message_object_new_ex(Z_OBJCE_P(this_ptr), http_message_dup(obj->message), NULL);
-}
-
-static inline void _http_message_object_declare_default_properties(TSRMLS_D)
-{
- zend_class_entry *ce = http_message_object_ce;
-
-#ifndef WONKY
- DCL_CONST(long, "TYPE_NONE", HTTP_MSG_NONE);
- DCL_CONST(long, "TYPE_REQUEST", HTTP_MSG_REQUEST);
- DCL_CONST(long, "TYPE_RESPONSE", HTTP_MSG_RESPONSE);
-#endif
-
- DCL_PROP(PROTECTED, long, type, HTTP_MSG_NONE);
- DCL_PROP(PROTECTED, string, body, "");
- DCL_PROP(PROTECTED, string, requestMethod, "");
- DCL_PROP(PROTECTED, string, requestUrl, "");
- DCL_PROP(PROTECTED, string, responseStatus, "");
- DCL_PROP(PROTECTED, long, responseCode, 0);
- DCL_PROP_N(PROTECTED, httpVersion);
- DCL_PROP_N(PROTECTED, headers);
- DCL_PROP_N(PROTECTED, parentMessage);
+ zend_object_value new_ov;
+ http_message_object *new_obj = NULL;
+ getObject(http_message_object, old_obj);
+
+ new_ov = http_message_object_new_ex(old_obj->zo.ce, http_message_dup(old_obj->message), &new_obj);
+ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
+
+ return new_ov;