Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -4411,12 +4411,17 @@ ZEND_API void zend_get_callable_zval_from_fcc(const zend_fcall_info_cache *fcc,
}
}

ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
ZEND_API const char *zend_get_module_version_ex(const char *module_name, size_t module_name_len)
{
size_t name_len = strlen(module_name);
zend_module_entry *module = zend_hash_str_find_ptr_lc(&module_registry, module_name, name_len);
zend_module_entry *module = zend_hash_str_find_ptr_lc(&module_registry, module_name, module_name_len);
return module ? module->version : NULL;
}

ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
{
size_t name_len = strlen(module_name);
return zend_get_module_version_ex(module_name, name_len);
}
/* }}} */

static zend_always_inline bool is_persistent_class(const zend_class_entry *ce) {
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ ZEND_API bool zend_is_callable_at_frame(
ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name);
ZEND_API const char *zend_get_module_version(const char *module_name);
ZEND_API const char *zend_get_module_version_ex(const char *module_name, size_t module_name_name_len);
ZEND_API zend_result zend_get_module_started(const char *module_name);

ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment, zend_type type);
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ PHP_FUNCTION(phpversion)
RETURN_STRING(PHP_VERSION);
} else {
const char *version;
version = zend_get_module_version(ext_name);
version = zend_get_module_version_ex(ext_name, ext_name_len);
if (version == NULL) {
RETURN_FALSE;
}
Expand Down
Loading