mirror of
https://github.com/php/php-src.git
synced 2024-11-26 11:23:47 +08:00
(PHP var_dump, serialize) now use php.ini's precision size when displying/serializing doubles
@- serialize() and var_dump() now honor the precision as set in php.ini @ for doubles. (Thies)
This commit is contained in:
parent
b1f13fcc35
commit
c6b05b2e6b
@ -53,9 +53,11 @@ void php_var_dump(pval **struc, int level)
|
||||
PHPWRITE(&buf[1], i - 1);
|
||||
break;
|
||||
|
||||
case IS_DOUBLE:
|
||||
i = sprintf(buf, "%*cfloat(%g)\n", level, ' ', (*struc)->value.dval);
|
||||
PHPWRITE(&buf[1], i - 1);
|
||||
case IS_DOUBLE: {
|
||||
ELS_FETCH();
|
||||
i = sprintf(buf, "%*cfloat(%.*G)\n", level, ' ', (int) EG(precision), (*struc)->value.dval);
|
||||
PHPWRITE(&buf[1], i - 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case IS_STRING:
|
||||
@ -199,9 +201,11 @@ void php_var_serialize(pval *buf, pval **struc)
|
||||
STR_CAT(buf, s, slen);
|
||||
return;
|
||||
|
||||
case IS_DOUBLE:
|
||||
slen = sprintf(s, "d:%g;", (*struc)->value.dval);
|
||||
STR_CAT(buf, s, slen);
|
||||
case IS_DOUBLE: {
|
||||
ELS_FETCH();
|
||||
slen = sprintf(s, "d:%.*G;",(int) EG(precision), (*struc)->value.dval);
|
||||
STR_CAT(buf, s, slen);
|
||||
}
|
||||
return;
|
||||
|
||||
case IS_STRING:{
|
||||
|
Loading…
Reference in New Issue
Block a user