summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-09-21 21:36:09 +0200
committerNikita Popov <nikic@php.net>2016-09-28 19:21:51 +0200
commitbf907b9961000dfb9b3bf3bd8a1e00e327a8268e (patch)
tree92281583c6e5f5449596f54ec719b0f35042719e /ext/reflection/php_reflection.c
parent4c0804c07de703826e38646bb6cc6d6ca633ddc4 (diff)
downloadphp-git-bf907b9961000dfb9b3bf3bd8a1e00e327a8268e.tar.gz
Revert ReflectionType::__toString() behavior + deprecate
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 16601ee4d6..47c09d4521 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -3022,23 +3022,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->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));
}
/* }}} */
@@ -6711,7 +6701,7 @@ static const zend_function_entry reflection_type_functions[] = {
ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
ZEND_ME(reflection_type, allowsNull, arginfo_reflection__void, 0)
ZEND_ME(reflection_type, isBuiltin, arginfo_reflection__void, 0)
- ZEND_ME(reflection_type, __toString, arginfo_reflection__void, 0)
+ ZEND_ME(reflection_type, __toString, arginfo_reflection__void, ZEND_ACC_DEPRECATED)
PHP_FE_END
};