From 157864af49eab6561e02412e7838d9a195968efe Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 28 Nov 2025 19:47:44 +0100 Subject: [PATCH] reflection: Use zend_hash_find_ptr_lc() where possible --- ext/reflection/php_reflection.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 4cf3edd4737..d6e55c982b4 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6639,18 +6639,17 @@ ZEND_METHOD(ReflectionExtension, __construct) zval *object; reflection_object *intern; zend_module_entry *module; - char *name_str; - size_t name_len; + zend_string *name_str; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name_str) == FAILURE) { RETURN_THROWS(); } object = ZEND_THIS; intern = Z_REFLECTION_P(object); - if ((module = zend_hash_str_find_ptr_lc(&module_registry, name_str, name_len)) == NULL) { + if ((module = zend_hash_find_ptr_lc(&module_registry, name_str)) == NULL) { zend_throw_exception_ex(reflection_exception_ptr, 0, - "Extension \"%s\" does not exist", name_str); + "Extension \"%s\" does not exist", ZSTR_VAL(name_str)); RETURN_THROWS(); } zval *prop_name = reflection_prop_name(object);