From: Xinchen Hui Date: Sun, 24 Jul 2016 03:01:19 +0000 (+0800) Subject: Fixed bug #72661 (ReflectionType::__toString crashes with iterable) X-Git-Tag: php-7.1.0beta2~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a3a797dbd56a5b9f71eb2b5c82a5722314642640;p=php Fixed bug #72661 (ReflectionType::__toString crashes with iterable) --- diff --git a/NEWS b/NEWS index c9cce02259..b0deb13608 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PHP NEWS . Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property). (Laruence) +- Reflection: + . Fixed bug #72661 (ReflectionType::__toString crashes with iterable). + (Laruence) + - SPL: . Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape character). (cmb) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 0c9a8dbed1..ef04ecdb98 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3025,6 +3025,7 @@ ZEND_METHOD(reflection_type, __toString) case IS_LONG: RETURN_STRINGL("int", sizeof("int") - 1); case IS_DOUBLE: RETURN_STRINGL("float", sizeof("float") - 1); case IS_VOID: RETURN_STRINGL("void", sizeof("void") - 1); + case IS_ITERABLE: RETURN_STRINGL("iterable", sizeof("iterable") - 1); EMPTY_SWITCH_DEFAULT_CASE() } } diff --git a/ext/reflection/tests/bug72661.phpt b/ext/reflection/tests/bug72661.phpt new file mode 100644 index 0000000000..40d14922b8 --- /dev/null +++ b/ext/reflection/tests/bug72661.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #72661 (ReflectionType::__toString crashes with iterable) +--FILE-- +getType()); +?> +--EXPECT-- +string(8) "iterable"