diff --git a/python_handlers.c b/python_handlers.c index ec35eec..e6fc21f 100644 --- a/python_handlers.c +++ b/python_handlers.c @@ -511,7 +511,9 @@ python_get_method(zval **object_ptr, char *method, int method_len TSRMLS_DC) f->scope = pip->ce; f->fn_flags = 0; f->prototype = NULL; - f->pass_rest_by_reference = 0; + #if PHP_VERSION_ID < 50400 + f->pass_rest_by_reference = 0; + #endif f->num_args = python_get_arg_info(func, &(f->arg_info) TSRMLS_CC); Py_DECREF(func); diff --git a/python_object.c b/python_object.c index 8e11511..82b99db 100644 --- a/python_object.c +++ b/python_object.c @@ -104,9 +104,15 @@ python_object_create(zend_class_entry *ce TSRMLS_DC) pip->ce = ce; zend_object_std_init(&pip->base, ce TSRMLS_CC); - zend_hash_copy(pip->base.properties, &ce->default_properties, - (copy_ctor_func_t)zval_add_ref, - (void *) &tmp, sizeof(zval *)); + + #if PHP_VERSION_ID < 50399 + zend_hash_copy(pip->base.properties, &ce->default_properties, + (copy_ctor_func_t)zval_add_ref, + (void *) &tmp, sizeof(zval *)); + #else + object_properties_init(&(pip->base), ce); + #endif + /* Add this instance to the objects store using the Zend Objects API. */ retval.handle = zend_objects_store_put(pip,