Skip to content

Commit 61239e1

Browse files
committed
Let's keep it simple
1 parent d9c28c5 commit 61239e1

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Zend/zend_API.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,16 +2003,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
20032003
}
20042004
if (info->type_hint) {
20052005
if (info->class_name) {
2006-
uint32_t fetch_type;
2007-
zend_string *class_name;
2008-
ALLOCA_FLAG(use_heap);
2009-
2010-
ZEND_ASSERT(info->type_hint == IS_OBJECT);
2011-
STR_ALLOCA_INIT(class_name, info->class_name, strlen(info->class_name), use_heap);
2012-
fetch_type = zend_get_class_fetch_type(class_name);
2013-
STR_ALLOCA_FREE(class_name, use_heap);
2014-
2015-
if (fetch_type != ZEND_FETCH_CLASS_DEFAULT && !scope) {
2006+
if (!scope && (!strcasecmp(info->class_name, "self") || !strcasecmp(info->class_name, "parent"))) {
20162007
zend_error(E_CORE_ERROR, "Cannot declare a return type of %s outside of a class scope", info->class_name);
20172008
}
20182009
}

0 commit comments

Comments
 (0)