static zval *php_http_message_object_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *rv);
static void php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot);
-static HashTable *php_http_message_object_get_props(zval *object);
static zend_object_handlers php_http_message_object_handlers;
static HashTable php_http_message_object_prophandlers;
/* add ref, because we previously have not been a parent message */
Z_ADDREF_P(zmsg);
- RETVAL_OBJECT(&objects[last]->zo, 1);
+ /* no addref, because we've been a parent message previously */
+ RETVAL_OBJECT(&objects[last]->zo, 0);
efree(objects);
} else {
ZVAL_COPY_VALUE(return_value, tmp);
}
} else {
- return_value = php_property_proxy_zval(object, member_name);
+ php_property_proxy_t *proxy;
+ php_property_proxy_object_t *proxy_obj;
+
+ proxy = php_property_proxy_init(object, member_name);
+ proxy_obj = php_property_proxy_object_new_ex(NULL, proxy);
+
+ ZVAL_OBJ(tmp, &proxy_obj->zo);
+ return tmp;
}
zend_string_release(member_name);
zend_string_release(member_name);
}
-static HashTable *php_http_message_object_get_props(zval *object)
+static HashTable *php_http_message_object_get_debug_info(zval *object, int *is_temp)
{
zval tmp;
php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, object);
size_t ver_len, url_len = 0;
PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
+ *is_temp = 0;
#define UPDATE_PROP(name_str, action_with_tmp) \
do { \
zend_property_info *pi; \
if ((pi = zend_hash_str_find_ptr(&obj->zo.ce->properties_info, name_str, lenof(name_str)))) { \
action_with_tmp; \
- zend_hash_update(props, pi->name, &tmp); \
+ zend_hash_update_ind(props, pi->name, &tmp); \
} \
} while(0)
php_http_message_object_handlers.free_obj = php_http_message_object_free;
php_http_message_object_handlers.read_property = php_http_message_object_read_prop;
php_http_message_object_handlers.write_property = php_http_message_object_write_prop;
- php_http_message_object_handlers.get_properties = php_http_message_object_get_props;
+ php_http_message_object_handlers.get_debug_info = php_http_message_object_get_debug_info;
php_http_message_object_handlers.get_property_ptr_ptr = NULL;
zend_class_implements(php_http_message_class_entry, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator);