Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  zend_enum: Rename try parameter to avoid conflict with C++
This commit is contained in:
Christoph M. Becker 2024-08-07 14:55:14 +02:00
commit aa709dc05b
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
2 changed files with 6 additions and 6 deletions

View file

@ -286,7 +286,7 @@ static ZEND_NAMED_FUNCTION(zend_enum_cases_func)
} ZEND_HASH_FOREACH_END();
}
ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool try)
ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool try_from)
{
if (ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
if (zend_update_class_constants(ce) == FAILURE) {
@ -310,7 +310,7 @@ ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_clas
if (case_name_zv == NULL) {
not_found:
if (try) {
if (try_from) {
*result = NULL;
return SUCCESS;
}
@ -340,7 +340,7 @@ not_found:
return SUCCESS;
}
static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try)
static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try_from)
{
zend_class_entry *ce = execute_data->func->common.scope;
bool release_string = false;
@ -375,12 +375,12 @@ static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try)
}
zend_object *case_obj;
if (zend_enum_get_case_by_value(&case_obj, ce, long_key, string_key, try) == FAILURE) {
if (zend_enum_get_case_by_value(&case_obj, ce, long_key, string_key, try_from) == FAILURE) {
goto throw;
}
if (case_obj == NULL) {
ZEND_ASSERT(try);
ZEND_ASSERT(try_from);
goto return_null;
}

View file

@ -44,7 +44,7 @@ ZEND_API void zend_enum_add_case(zend_class_entry *ce, zend_string *case_name, z
ZEND_API void zend_enum_add_case_cstr(zend_class_entry *ce, const char *name, zval *value);
ZEND_API zend_object *zend_enum_get_case(zend_class_entry *ce, zend_string *name);
ZEND_API zend_object *zend_enum_get_case_cstr(zend_class_entry *ce, const char *name);
ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool try);
ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool try_from);
static zend_always_inline zval *zend_enum_fetch_case_name(zend_object *zobj)
{