diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-08-20 01:06:06 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-08-21 00:12:47 -0500 |
commit | 8855a2ce76e8bfba1d2eea1345c765fde7a9a441 (patch) | |
tree | f844dbbcae4db70c7b38ed2b03c955c2cd6336c6 /ext/reflection/php_reflection.c | |
parent | 08c5d77027cbd65abe8dab6149d4de91daabb9c7 (diff) | |
download | php-git-8855a2ce76e8bfba1d2eea1345c765fde7a9a441.tar.gz |
Do not prepend ? on nullables in ReflectionType::__toString()
Better BC with 7.0.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 66ffeab196..a164cbda72 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3028,32 +3028,13 @@ ZEND_METHOD(reflection_type, __toString) { reflection_object *intern; type_reference *param; - zend_string *str; if (zend_parse_parameters_none() == FAILURE) { return; } GET_REFLECTION_OBJECT_PTR(param); - 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")) { - size_t orig_len = ZSTR_LEN(str); - str = zend_string_extend(str, orig_len + 1, 0); - memmove(ZSTR_VAL(str) + 1, ZSTR_VAL(str), orig_len + 1); - ZSTR_VAL(str)[0] = '\\'; - } - - if (param->arg_info->allow_null) { - size_t orig_len = ZSTR_LEN(str); - str = zend_string_extend(str, orig_len + 1, 0); - memmove(ZSTR_VAL(str) + 1, ZSTR_VAL(str), orig_len + 1); - ZSTR_VAL(str)[0] = '?'; - } - - RETURN_STR(str); + RETURN_STR(reflection_type_name(param)); } /* }}} */ |