+static HashTable *php_http_message_object_get_gc(zval *object, zval **table, int *n)
+{
+ php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, object);
+ HashTable *props = Z_OBJPROP_P(object);
+ uint32_t count = 2 + zend_hash_num_elements(props);
+ zval *val;
+
+ *n = 0;
+ *table = obj->gc = erealloc(obj->gc, count * sizeof(zval));
+
+ if (obj->body) {
+ ZVAL_OBJ(&obj->gc[(*n)++], &obj->body->zo);
+ }
+ if (obj->parent) {
+ ZVAL_OBJ(&obj->gc[(*n)++], &obj->parent->zo);
+ }
+
+ ZEND_HASH_FOREACH_VAL(props, val)
+ {
+ ZVAL_COPY_VALUE(&obj->gc[(*n)++], val);
+ }
+ ZEND_HASH_FOREACH_END();
+
+ return NULL;
+}
+