From: Johannes Schlüter Date: Mon, 11 Sep 2006 17:06:59 +0000 (+0000) Subject: - Fix #37923 (Display constant value in reflection::export) X-Git-Tag: RELEASE_1_0_0RC1~1701 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90db332cffd468614442063ccdbf5a6608257378;p=php - Fix #37923 (Display constant value in reflection::export) --- diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index c843537cbb..9781547c69 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -530,10 +530,23 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in /* {{{ _const_string */ static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC) { - string_printf(str, "%s Constant [ %s %v ] { }\n", + zval value_copy; + int use_copy; + + zend_make_printable_zval(value, &value_copy, &use_copy); + if (use_copy) { + value = &value_copy; + } + + string_printf(str, "%s Constant [ %s %v ] { %s }\n", indent, zend_zval_type_name(value), - name); + name, + Z_STRVAL_P(value)); + + if (use_copy) { + zval_dtor(value); + } } /* }}} */