From: Xinchen Hui Date: Tue, 22 Nov 2011 10:11:06 +0000 (+0000) Subject: Fixed bug #60357 (__toString() method triggers E_NOTICE "Array to string conversion") X-Git-Tag: php-5.5.0alpha1~843 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f5ca6f28054e7a590b1aed9284c4c0e3b38ed30;p=php Fixed bug #60357 (__toString() method triggers E_NOTICE "Array to string conversion") --- diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index a6339fa56f..1e0386a601 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -746,6 +746,8 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg string_write(str, "...", sizeof("...")-1); } string_write(str, "'", sizeof("'")-1); + } else if (Z_TYPE_P(zv) == IS_ARRAY) { + string_write(str, "Array", sizeof("Array")-1); } else { zend_make_printable_zval(zv, &zv_copy, &use_copy); string_write(str, Z_STRVAL(zv_copy), Z_STRLEN(zv_copy)); diff --git a/ext/reflection/tests/bug60357.phpt b/ext/reflection/tests/bug60357.phpt new file mode 100644 index 0000000000..a5ddd4096c --- /dev/null +++ b/ext/reflection/tests/bug60357.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #60357 (__toString() method triggers E_NOTICE "Array to string conversion") +--FILE-- +__toString(); +?> +--EXPECTF-- +Parameter #0 [ array $x = Array ]