From 07d6dfbfe40848173ab2136d9c9eba862dc9fca0 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 26 Nov 2018 15:26:48 +0100 Subject: [PATCH] Use zend_empty_array No need to define our own `com_dotnet_object_properties` as empty hash, since we can use `zend_empty_array` instead as of PHP 7.3.0. Cf. . --- ext/com_dotnet/com_extension.c | 2 -- ext/com_dotnet/com_handlers.c | 4 +--- ext/com_dotnet/php_com_dotnet_internal.h | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index 24d69b7a34..a9fd0e7fde 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -293,8 +293,6 @@ PHP_MINIT_FUNCTION(com_dotnet) { zend_class_entry ce, *tmp; - zend_hash_init(&com_dotnet_object_properties, 0, NULL, NULL, 0); - php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU); php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU); diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 3a4b705b80..66218cfae8 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -27,8 +27,6 @@ #include "php_com_dotnet_internal.h" #include "Zend/zend_exceptions.h" -const HashTable com_dotnet_object_properties; - static zval *com_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv) { php_com_dotnet_object *obj; @@ -231,7 +229,7 @@ static HashTable *com_properties_get(zval *object) * infinite recursion when the hash is displayed via var_dump(). * Perhaps it is best to leave it un-implemented. */ - return &com_dotnet_object_properties; + return &zend_empty_array; } static void function_dtor(zval *zv) diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h index c5284b93cf..a2fe813683 100644 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ b/ext/com_dotnet/php_com_dotnet_internal.h @@ -29,8 +29,6 @@ #include "zend_ts_hash.h" -extern const HashTable com_dotnet_object_properties; - typedef struct _php_com_dotnet_object { zend_object zo; -- 2.40.0