summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 3c1ca4c718..87cfd5f139 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2054,7 +2054,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
internal_function->num_args--;
}
if (ZEND_TYPE_IS_SET(info->type)) {
- if (ZEND_TYPE_IS_CLASS(info->type)) {
+ if (ZEND_TYPE_HAS_NAME(info->type)) {
const char *type_name = ZEND_TYPE_LITERAL_NAME(info->type);
if (!scope && (!strcasecmp(type_name, "self") || !strcasecmp(type_name, "parent"))) {
zend_error_noreturn(E_CORE_ERROR, "Cannot declare a return type of %s outside of a class scope", type_name);
@@ -2135,7 +2135,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
memcpy(new_arg_info, arg_info, sizeof(zend_arg_info) * num_args);
reg_function->common.arg_info = new_arg_info + 1;
for (i = 0; i < num_args; i++) {
- if (ZEND_TYPE_IS_CLASS(new_arg_info[i].type)) {
+ if (ZEND_TYPE_HAS_CLASS(new_arg_info[i].type)) {
+ ZEND_ASSERT(ZEND_TYPE_HAS_NAME(new_arg_info[i].type)
+ && "Only simple classes are currently supported");
const char *class_name = ZEND_TYPE_LITERAL_NAME(new_arg_info[i].type);
ZEND_TYPE_SET_PTR(new_arg_info[i].type,
zend_string_init_interned(class_name, strlen(class_name), 1));