summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authornikita2206 <inefedor@gmail.com>2016-05-16 02:58:21 +0300
committerNikita Popov <nikic@php.net>2016-07-13 21:39:55 +0200
commiteb190b4e917e537380a505c4c28b9dc2c5b3c295 (patch)
tree6ead6d22df1044fe792041a81baa804869fa4d34 /ext/reflection/php_reflection.c
parent1896ca4e88451d5190d3ce921d6f7a52b3ec6e9f (diff)
downloadphp-git-eb190b4e917e537380a505c4c28b9dc2c5b3c295.tar.gz
fix: bug72222 for PHP-5.6 reflection export of array consts
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index fbcf7a77ca..5f15287237 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -673,21 +673,26 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC)
{
char *type;
- zval value_copy;
- int use_copy;
-
type = zend_zval_type_name(value);
- zend_make_printable_zval(value, &value_copy, &use_copy);
- if (use_copy) {
- value = &value_copy;
- }
+ if (Z_TYPE_P(value) == IS_ARRAY) {
+ string_printf(str, "%s Constant [ %s %s ] { Array }\n",
+ indent, type, name);
+ } else {
+ zval value_copy;
+ int use_copy;
- string_printf(str, "%s Constant [ %s %s ] { %s }\n",
- indent, type, name, Z_STRVAL_P(value));
+ zend_make_printable_zval(value, &value_copy, &use_copy);
+ if (use_copy) {
+ value = &value_copy;
+ }
+
+ string_printf(str, "%s Constant [ %s %s ] { %s }\n",
+ indent, type, name, Z_STRVAL_P(value));
- if (use_copy) {
- zval_dtor(value);
+ if (use_copy) {
+ zval_dtor(value);
+ }
}
}
/* }}} */