com php-src: Let's keep it simple: Zend/zend_API.c

From: Date: Sat, 07 Feb 2015 11:43:00 +0000
Subject: com php-src: Let's keep it simple: Zend/zend_API.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85207@lists.php.net to get a copy of this message
Commit: 61239e1e8bd53260c3c280df3e990e3d303e45bd Author: Reeze Xia <reeze@php.net> Sat, 7 Feb 2015 19:43:00 +0800 Parents: d9c28c558172281f78b47846357e1f48154d6a32 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=61239e1e8bd53260c3c280df3e990e3d303e45bd Log: Let's keep it simple Changed paths: M Zend/zend_API.c Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 260b062..cd7c202 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2003,16 +2003,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio } if (info->type_hint) { if (info->class_name) { - uint32_t fetch_type; - zend_string *class_name; - ALLOCA_FLAG(use_heap); - - ZEND_ASSERT(info->type_hint == IS_OBJECT); - STR_ALLOCA_INIT(class_name, info->class_name, strlen(info->class_name), use_heap); - fetch_type = zend_get_class_fetch_type(class_name); - STR_ALLOCA_FREE(class_name, use_heap); - - if (fetch_type != ZEND_FETCH_CLASS_DEFAULT && !scope) { + if (!scope && (!strcasecmp(info->class_name, "self") || !strcasecmp(info->class_name, "parent"))) { zend_error(E_CORE_ERROR, "Cannot declare a return type of %s outside of a class scope", info->class_name); } }

« previous php.cvs (#85207) next »