1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

reflection: Check against the known string in is_closure_invoke() (#21402)

This can likely succeed by just comparing pointers in a majority of cases.
This commit is contained in:
Tim Düsterhus
2026-03-10 20:06:34 +01:00
committed by GitHub
parent f29bc086f1
commit 6e664a04cb

View File

@@ -191,7 +191,7 @@ static zend_always_inline uint32_t prop_get_flags(const property_reference *ref)
static inline bool is_closure_invoke(const zend_class_entry *ce, const zend_string *lcname) {
return ce == zend_ce_closure
&& zend_string_equals_literal(lcname, ZEND_INVOKE_FUNC_NAME);
&& zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
}
static zend_function *_copy_function(zend_function *fptr) /* {{{ */