com php-src: Fixed bug #72661 (ReflectionType::__toSt ring crashes with iterable): NEWS ext/reflection/ php_reflection.c ext/reflection/tests/bug72661
.phpt
| From: | Xinchen Hui | Date: | Sun, 24 Jul 2016 03:01:19 +0000 |
| Subject: | com php-src: Fixed bug #72661 (ReflectionType::__toSt ring crashes with iterable): NEWS ext/reflection/ php_reflection.c ext/reflection/tests/bug72661 .phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93362@lists.php.net to get a copy of this message | ||
Commit: a3a797dbd56a5b9f71eb2b5c82a5722314642640
Author: Xinchen Hui <laruence@gmail.com> Sun, 24 Jul 2016 11:01:19 +0800
Parents: eaa8f497087aa17ae937408211df43bb7b1425f3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a3a797dbd56a5b9f71eb2b5c82a5722314642640
Log:
Fixed bug #72661 (ReflectionType::__toString crashes with iterable)
Bugs:
https://bugs.php.net/72661
Changed paths:
M NEWS
M ext/reflection/php_reflection.c
A ext/reflection/tests/bug72661.phpt
Diff:
diff --git a/NEWS b/NEWS
index c9cce02..b0deb13 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 0c9a8db..ef04ecd 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 0000000..40d1492
--- /dev/null
+++ b/ext/reflection/tests/bug72661.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #72661 (ReflectionType::__toString crashes with iterable)
+--FILE--
+<?php
+function test(iterable $arg) { }
+
+var_dump((string)(new ReflectionParameter("test", 0))->getType());
+?>
+--EXPECT--
+string(8) "iterable"