diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-08-16 11:28:33 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-08-16 11:28:33 -0500 |
commit | 20fdd47921f423728b409fd0ae0106dab9c34573 (patch) | |
tree | a594e8d5503bc96993a33801f2700008743cd08e /ext/reflection/php_reflection.c | |
parent | ba09a520d230506b26ba75e0714131b4ad16d034 (diff) | |
download | php-git-20fdd47921f423728b409fd0ae0106dab9c34573.tar.gz |
Append \ to class name returned from ReflectionType::__toString()
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 82d76457da..df15efd077 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3037,6 +3037,14 @@ ZEND_METHOD(reflection_type, __toString) str = reflection_type_name(param); + if (param->arg_info->type_hint == IS_OBJECT + && !zend_string_equals_literal_ci(param->arg_info->class_name, "self") + && !zend_string_equals_literal_ci(param->arg_info->class_name, "parent")) { + str = zend_string_extend(str, ZSTR_LEN(str) + 1, 0); + memmove(ZSTR_VAL(str) + 1, ZSTR_VAL(str), ZSTR_LEN(str) + 1); + ZSTR_VAL(str)[0] = '\\'; + } + if (param->arg_info->allow_null) { str = zend_string_extend(str, ZSTR_LEN(str) + 1, 0); memmove(ZSTR_VAL(str) + 1, ZSTR_VAL(str), ZSTR_LEN(str) + 1); |