@@ -560,30 +560,25 @@ static void _const_string(smart_str *str, char *name, zval *value, char *indent)
560
560
/* {{{ _class_const_string */
561
561
static void _class_const_string (smart_str * str , char * name , zend_class_constant * c , char * indent )
562
562
{
563
- char * visibility = zend_visibility_string (ZEND_CLASS_CONST_FLAGS (c ));
564
- const char * type ;
565
-
566
563
if (zval_update_constant_ex (& c -> value , c -> ce ) == FAILURE ) {
567
564
return ;
568
565
}
569
566
570
- type = zend_zval_type_name (& c -> value );
571
-
567
+ const char * visibility = zend_visibility_string (ZEND_CLASS_CONST_FLAGS (c ));
568
+ const char * type = zend_zval_type_name (& c -> value );
569
+ smart_str_append_printf (str , "%sConstant [ %s %s %s ] { " ,
570
+ indent , visibility , type , name );
572
571
if (Z_TYPE (c -> value ) == IS_ARRAY ) {
573
- smart_str_append_printf (str , "%sConstant [ %s %s %s ] { Array }\n" ,
574
- indent , visibility , type , name );
572
+ smart_str_appends (str , "Array" );
575
573
} else if (Z_TYPE (c -> value ) == IS_OBJECT ) {
576
- smart_str_append_printf (str , "%sConstant [ %s %s %s ] { Object }\n" ,
577
- indent , visibility , type , name );
574
+ smart_str_appends (str , "Object" );
578
575
} else {
579
576
zend_string * tmp_value_str ;
580
577
zend_string * value_str = zval_get_tmp_string (& c -> value , & tmp_value_str );
581
-
582
- smart_str_append_printf (str , "%sConstant [ %s %s %s ] { %s }\n" ,
583
- indent , visibility , type , name , ZSTR_VAL (value_str ));
584
-
578
+ smart_str_append (str , value_str );
585
579
zend_tmp_string_release (tmp_value_str );
586
580
}
581
+ smart_str_appends (str , " }\n" );
587
582
}
588
583
/* }}} */
589
584
0 commit comments