Skip to content

Commit aa709dc

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: zend_enum: Rename try parameter to avoid conflict with C++
2 parents 1d56340 + 423fc81 commit aa709dc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Zend/zend_enum.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static ZEND_NAMED_FUNCTION(zend_enum_cases_func)
286286
} ZEND_HASH_FOREACH_END();
287287
}
288288

289-
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)
289+
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)
290290
{
291291
if (ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
292292
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
310310

311311
if (case_name_zv == NULL) {
312312
not_found:
313-
if (try) {
313+
if (try_from) {
314314
*result = NULL;
315315
return SUCCESS;
316316
}
@@ -340,7 +340,7 @@ ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_clas
340340
return SUCCESS;
341341
}
342342

343-
static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try)
343+
static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try_from)
344344
{
345345
zend_class_entry *ce = execute_data->func->common.scope;
346346
bool release_string = false;
@@ -375,12 +375,12 @@ static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try)
375375
}
376376

377377
zend_object *case_obj;
378-
if (zend_enum_get_case_by_value(&case_obj, ce, long_key, string_key, try) == FAILURE) {
378+
if (zend_enum_get_case_by_value(&case_obj, ce, long_key, string_key, try_from) == FAILURE) {
379379
goto throw;
380380
}
381381

382382
if (case_obj == NULL) {
383-
ZEND_ASSERT(try);
383+
ZEND_ASSERT(try_from);
384384
goto return_null;
385385
}
386386

Zend/zend_enum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ZEND_API void zend_enum_add_case(zend_class_entry *ce, zend_string *case_name, z
4444
ZEND_API void zend_enum_add_case_cstr(zend_class_entry *ce, const char *name, zval *value);
4545
ZEND_API zend_object *zend_enum_get_case(zend_class_entry *ce, zend_string *name);
4646
ZEND_API zend_object *zend_enum_get_case_cstr(zend_class_entry *ce, const char *name);
47-
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);
47+
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);
4848

4949
static zend_always_inline zval *zend_enum_fetch_case_name(zend_object *zobj)
5050
{

0 commit comments

Comments
 (0)