[PHP-CVS] [php-src] master: Zend: Use zend_hash_find_ex_ptr() for __invoke

[email protected] (Weilin Du)
Newsgroups php.cvs
Message-ID <[email protected]>
Author: Weilin Du (LamentXU123)
Date: 2026-08-16T16:35:06+08:00

Commit: https://github.com/php/php-src/commit/98a259edd23cb132ac0b626dd9d4a8edacca4b3e
Raw diff: https://github.com/php/php-src/commit/98a259edd23cb132ac0b626dd9d4a8edacca4b3e.diff

Zend: Use zend_hash_find_ex_ptr() for __invoke

Changed paths:
  M  Zend/zend_object_handlers.c


Diff:

diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index c5ec6fe5515b..8ca6d212fd72 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -2615,12 +2615,13 @@ ZEND_API zend_result zend_std_cast_object_tostring(zend_object *readobj, zval *w
 ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */
 {
 	zend_class_entry *ce = obj->ce;
-	const zval *func = zend_hash_find_known_hash(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
+	zend_function *func = zend_hash_find_ex_ptr(
+		&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE), /* known_hash */ true);
 
 	if (func == NULL) {
 		return FAILURE;
 	}
-	*fptr_ptr = Z_FUNC_P(func);
+	*fptr_ptr = func;
 	*ce_ptr = ce;
 	*obj_ptr = obj;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.