Skip to content

Commit ad2dbc8

Browse files
committed
Use is_closure_invoke() with zend_string_equals_ci() in ReflectionClass
1 parent eec5f87 commit ad2dbc8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ext/reflection/php_reflection.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ static zend_always_inline uint32_t prop_get_flags(const property_reference *ref)
185185
return ref->prop ? ref->prop->flags : ZEND_ACC_PUBLIC;
186186
}
187187

188-
static inline bool is_closure_invoke(const zend_class_entry *ce, const zend_string *lcname) {
188+
static inline bool is_closure_invoke(const zend_class_entry *ce, const zend_string *name) {
189189
return ce == zend_ce_closure
190-
&& zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
190+
&& zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
191191
}
192192

193193
static zend_function *_copy_function(zend_function *fptr) /* {{{ */
@@ -4386,7 +4386,7 @@ ZEND_METHOD(ReflectionClass, hasMethod)
43864386

43874387
GET_REFLECTION_OBJECT_PTR(ce);
43884388
RETVAL_BOOL(zend_hash_find_ptr_lc(&ce->function_table, name) != NULL
4389-
|| (ce == zend_ce_closure && zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE))));
4389+
|| is_closure_invoke(ce, name));
43904390
}
43914391
/* }}} */
43924392

@@ -4405,7 +4405,7 @@ ZEND_METHOD(ReflectionClass, getMethod)
44054405
}
44064406

44074407
GET_REFLECTION_OBJECT_PTR(ce);
4408-
is_invoke = ce == zend_ce_closure && zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
4408+
is_invoke = is_closure_invoke(ce, name);
44094409
if (!Z_ISUNDEF(intern->obj) && is_invoke
44104410
&& (mptr = zend_get_closure_invoke_method(Z_OBJ(intern->obj))) != NULL)
44114411
{

0 commit comments

Comments
 (0)