]> granicus.if.org Git - php/commitdiff
Use zend_empty_array
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 26 Nov 2018 14:26:48 +0000 (15:26 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 26 Nov 2018 14:33:58 +0000 (15:33 +0100)
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. <https://github.com/php/php-src/pull/3672#issuecomment-440467704>.

ext/com_dotnet/com_extension.c
ext/com_dotnet/com_handlers.c
ext/com_dotnet/php_com_dotnet_internal.h

index 24d69b7a3485d6fbe36572466fb58c6eac0b1b30..a9fd0e7fde66cb09c9e01458f1a277364a0cbb9f 100644 (file)
@@ -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);
 
index 3a4b705b80c6bf9846ab435f177c09e868c12026..66218cfae82809bb15f4da0ba6dc5abbad0ce561 100644 (file)
@@ -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)
index c5284b93cff4f1e7f69a41d0d511bef0aa3b2a62..a2fe81368322c19edff92a146c183812b4cb4f5d 100644 (file)
@@ -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;