]> granicus.if.org Git - php/commitdiff
- Fix #37923 (Display constant value in reflection::export)
authorJohannes Schlüter <johannes@php.net>
Mon, 11 Sep 2006 17:06:59 +0000 (17:06 +0000)
committerJohannes Schlüter <johannes@php.net>
Mon, 11 Sep 2006 17:06:59 +0000 (17:06 +0000)
ext/reflection/php_reflection.c

index c843537cbb4c51631fa87f19511601b7022807bb..9781547c69da17291d062593ea0131ba08f7c2bc 100644 (file)
@@ -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);
+       }
 }
 /* }}} */