From: Nikita Popov Date: Mon, 7 Jan 2019 15:00:01 +0000 (+0100) Subject: Remove unnecessary uses of object_and_properties_init X-Git-Tag: php-7.4.0alpha1~1269 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba5cb2eb325ffb933e4120c173c44e2e674e1506;p=php Remove unnecessary uses of object_and_properties_init Use object_init_ex instead if the properties are NULL. --- diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index f74df1facb..f3d5e82309 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -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 { diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 66b4a15290..8d448bfe61 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -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 { diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 2796c7b7a8..9748594fa5 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -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"); }