Skip to content

Commit 6e664a0

Browse files
authored
reflection: Check against the known string in is_closure_invoke() (#21402)
This can likely succeed by just comparing pointers in a majority of cases.
1 parent f29bc08 commit 6e664a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/reflection/php_reflection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static zend_always_inline uint32_t prop_get_flags(const property_reference *ref)
191191

192192
static inline bool is_closure_invoke(const zend_class_entry *ce, const zend_string *lcname) {
193193
return ce == zend_ce_closure
194-
&& zend_string_equals_literal(lcname, ZEND_INVOKE_FUNC_NAME);
194+
&& zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
195195
}
196196

197197
static zend_function *_copy_function(zend_function *fptr) /* {{{ */

0 commit comments

Comments
 (0)