summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-06-15 15:44:44 +0300
committerDmitry Stogov <dmitry@zend.com>2015-06-15 15:44:44 +0300
commit33e71d5c20ebdaaee9c4d12a82f65ae2cded7cbc (patch)
tree9cc256f0d7eb06586009e0e16d99d0ba0e7a52d8 /ext/reflection/php_reflection.c
parent562bffe60ed85ba89920fb3918229c544eec15e9 (diff)
downloadphp-git-33e71d5c20ebdaaee9c4d12a82f65ae2cded7cbc.tar.gz
Fixed bug #69802 (Reflection on Closure::__invoke borks type hint class name)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 4c570d7573..c8c5a527ab 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2620,7 +2620,10 @@ ZEND_METHOD(reflection_parameter, getClass)
const char *class_name;
size_t class_name_len;
- if (param->fptr->type == ZEND_INTERNAL_FUNCTION) {
+ if (param->fptr->type == ZEND_INTERNAL_FUNCTION &&
+ /* Closure::__invoke() reuses arg_info of user function and
+ * don't set ZEND_ACC_HAS_TYPE_HINTS flag */
+ (param->fptr->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
class_name = ((zend_internal_arg_info*)param->arg_info)->class_name;
class_name_len = strlen(class_name);
} else {
@@ -2648,7 +2651,8 @@ ZEND_METHOD(reflection_parameter, getClass)
}
ce = ce->parent;
} else {
- if (param->fptr->type == ZEND_INTERNAL_FUNCTION) {
+ if (param->fptr->type == ZEND_INTERNAL_FUNCTION &&
+ (param->fptr->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
zend_string *name = zend_string_init(class_name, class_name_len, 0);
ce = zend_lookup_class(name);
zend_string_release(name);