Skip to content

Commit 88d8aac

Browse files
committed
Use is_closure_invoke() with zend_string_equals_ci() in ReflectionClass
1 parent 6a763c9 commit 88d8aac

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

44794479
GET_REFLECTION_OBJECT_PTR(ce);
44804480
RETVAL_BOOL(zend_hash_find_ptr_lc(&ce->function_table, name) != NULL
4481-
|| (ce == zend_ce_closure && zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE))));
4481+
|| is_closure_invoke(ce, name));
44824482
}
44834483
/* }}} */
44844484

@@ -4497,7 +4497,7 @@ ZEND_METHOD(ReflectionClass, getMethod)
44974497
}
44984498

44994499
GET_REFLECTION_OBJECT_PTR(ce);
4500-
is_invoke = ce == zend_ce_closure && zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
4500+
is_invoke = is_closure_invoke(ce, name);
45014501
if (!Z_ISUNDEF(intern->obj) && is_invoke
45024502
&& (mptr = zend_get_closure_invoke_method(Z_OBJ(intern->obj))) != NULL)
45034503
{

0 commit comments

Comments
 (0)