]> granicus.if.org Git - php/commitdiff
Remove unnecessary uses of object_and_properties_init
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 7 Jan 2019 15:00:01 +0000 (16:00 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 7 Jan 2019 15:00:29 +0000 (16:00 +0100)
Use object_init_ex instead if the properties are NULL.

ext/mysqli/mysqli.c
ext/pgsql/pgsql.c
ext/reflection/php_reflection.c

index f74df1facb4cfb505a93faa4119ef4521843b11d..f3d5e823099b64b85706ad2e8853034cf88972df 100644 (file)
@@ -1267,7 +1267,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
 
                ZVAL_COPY_VALUE(&dataset, return_value);
 
-               object_and_properties_init(return_value, ce, NULL);
+               object_init_ex(return_value, ce);
                if (!ce->default_properties_count && !ce->__set) {
                        Z_OBJ_P(return_value)->properties = Z_ARR(dataset);
                } else {
index 66b4a152903cb574aca56a068fcf39f33537a8d0..8d448bfe614788feb09285107d5f05ec12e3d3f8 100644 (file)
@@ -2797,7 +2797,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
                zval retval;
 
                ZVAL_COPY_VALUE(&dataset, return_value);
-               object_and_properties_init(return_value, ce, NULL);
+               object_init_ex(return_value, ce);
                if (!ce->default_properties_count && !ce->__set) {
                        Z_OBJ_P(return_value)->properties = Z_ARR(dataset);
                } else {
index 2796c7b7a8d7d3045b6608c06cad95201e50fcbc..9748594fa501c4dc64d9be9760541ce9f6692973 100644 (file)
@@ -1300,7 +1300,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
        }
 
        /* Create object */
-       if (object_and_properties_init(&reflector, ce_ptr, NULL) == FAILURE) {
+       if (object_init_ex(&reflector, ce_ptr) == FAILURE) {
                _DO_THROW("Could not create reflector");
        }