- Fixed build with 5.4+
[m6w6/ext-http] / http_request_object.c
index 8ea09b0f0af7a2528a1dbf01957b206dfd8f5175..d502006f60a044d93a8e7142cf59bd5b6a12529c 100644 (file)
@@ -492,9 +492,14 @@ zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, ht
                *ptr = o;
        }
 
+#ifdef ZEND_ENGINE_2_4
+       zend_object_std_init(OBJ_PROP(o), ce TSRMLS_CC);
+       object_properties_init(OBJ_PROP(o), ce);
+#else
        ALLOC_HASHTABLE(OBJ_PROP(o));
        zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
        zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+#endif
 
        ov.handle = putObject(http_request_object, o);
        ov.handlers = &http_request_object_handlers;