Make sure dnumbers are printed as dnumbers even if they could be printed as ints

This commit is contained in:
nikic 2011-06-02 23:13:05 +02:00
parent eaffc0073c
commit c94b09dec0

View File

@ -67,7 +67,9 @@ class PrettyPrinter_Zend extends PrettyPrinterAbstract
}
public function pScalar_DNumber(Node_Scalar_DNumber $node) {
return (string) $node->value;
return (int) $node->value == $node->value
? (string) $node->value . '.0' // ensure that number is really printed as float
: (string) $node->value;
}
// Assignments