summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2006-09-11 17:08:42 +0000
committerJohannes Schlüter <johannes@php.net>2006-09-11 17:08:42 +0000
commit6a1b4c99c72c586757248beae059833981e7f7fc (patch)
tree2856d156bcda4af9b1320557a3b7c1557607998e /ext/reflection/php_reflection.c
parentf4a75d91d24bd07cdf7fea5897a1d5efd9f4679e (diff)
downloadphp-git-6a1b4c99c72c586757248beae059833981e7f7fc.tar.gz
- MFH: Fix #37923 (Display constant value in reflection::export)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 483246a8cb..bd63658c8b 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -537,10 +537,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 %s ] { }\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 %s ] { %s }\n",
indent,
zend_zval_type_name(value),
- name);
+ name,
+ Z_STRVAL_P(value));
+
+ if (use_copy) {
+ zval_dtor(value);
+ }
}
/* }}} */