Skip to content

Commit 157864a

Browse files
committed
reflection: Use zend_hash_find_ptr_lc() where possible
1 parent 13bf672 commit 157864a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ext/reflection/php_reflection.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6639,18 +6639,17 @@ ZEND_METHOD(ReflectionExtension, __construct)
66396639
zval *object;
66406640
reflection_object *intern;
66416641
zend_module_entry *module;
6642-
char *name_str;
6643-
size_t name_len;
6642+
zend_string *name_str;
66446643

6645-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) {
6644+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name_str) == FAILURE) {
66466645
RETURN_THROWS();
66476646
}
66486647

66496648
object = ZEND_THIS;
66506649
intern = Z_REFLECTION_P(object);
6651-
if ((module = zend_hash_str_find_ptr_lc(&module_registry, name_str, name_len)) == NULL) {
6650+
if ((module = zend_hash_find_ptr_lc(&module_registry, name_str)) == NULL) {
66526651
zend_throw_exception_ex(reflection_exception_ptr, 0,
6653-
"Extension \"%s\" does not exist", name_str);
6652+
"Extension \"%s\" does not exist", ZSTR_VAL(name_str));
66546653
RETURN_THROWS();
66556654
}
66566655
zval *prop_name = reflection_prop_name(object);

0 commit comments

Comments
 (0)