Skip to content

Commit a774713

Browse files
committed
Use is_closure_invoke() with zend_string_equals_ci() in ReflectionClass
1 parent 95d98bf commit a774713

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) /* {{{ */
@@ -4409,7 +4409,7 @@ ZEND_METHOD(ReflectionClass, hasMethod)
44094409

44104410
GET_REFLECTION_OBJECT_PTR(ce);
44114411
RETVAL_BOOL(zend_hash_find_ptr_lc(&ce->function_table, name) != NULL
4412-
|| (ce == zend_ce_closure && zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE))));
4412+
|| is_closure_invoke(ce, name));
44134413
}
44144414
/* }}} */
44154415

@@ -4428,7 +4428,7 @@ ZEND_METHOD(ReflectionClass, getMethod)
44284428
}
44294429

44304430
GET_REFLECTION_OBJECT_PTR(ce);
4431-
is_invoke = ce == zend_ce_closure && zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
4431+
is_invoke = is_closure_invoke(ce, name);
44324432
if (!Z_ISUNDEF(intern->obj) && is_invoke
44334433
&& (mptr = zend_get_closure_invoke_method(Z_OBJ(intern->obj))) != NULL)
44344434
{

0 commit comments

Comments
 (0)