}
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 PHP_WRITE_PROP_HANDLER_TYPE php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot);
static zend_object_handlers php_http_message_object_handlers;
static HashTable php_http_message_object_prophandlers;
zend_object_std_dtor(object);
}
+#if PHP_VERSION_ID >= 70400
+static zval *php_http_message_object_get_prop_ptr(zval *object, zval *member, int type, void **cache_slot)
+{
+ return NULL;
+}
+#endif
+
static zval *php_http_message_object_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *tmp)
{
zval *return_value;
return_value = zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, tmp);
if (handler && handler->read) {
- if (type == BP_VAR_R || type == BP_VAR_IS) {
- php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, object);
+ php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, object);
- handler->read(obj, return_value);
- } else {
- 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_value = tmp;
- }
+ handler->read(obj, return_value);
}
zend_string_release(member_name);
return return_value;
}
-static void php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot)
+static PHP_WRITE_PROP_HANDLER_TYPE php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot)
{
php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, object);
php_http_message_object_prophandler_t *handler;
}
zend_string_release(member_name);
+ PHP_WRITE_PROP_HANDLER_RETURN(value);
}
static HashTable *php_http_message_object_get_debug_info(zval *object, int *is_temp)
PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
if (obj->message->type != PHP_HTTP_RESPONSE) {
- php_error_docref(NULL, E_WARNING, "http\\Message is not if type response");
+ php_error_docref(NULL, E_WARNING, "http\\Message is not of type response");
RETURN_FALSE;
}
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_debug_info = php_http_message_object_get_debug_info;
+#if PHP_VERSION_ID >= 70400
+ php_http_message_object_handlers.get_property_ptr_ptr = php_http_message_object_get_prop_ptr;
+#else
php_http_message_object_handlers.get_property_ptr_ptr = NULL;
+#endif
php_http_message_object_handlers.get_gc = php_http_message_object_get_gc;
zend_class_implements(php_http_message_class_entry, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator);