diff --git a/src/BigNumber.php b/src/BigNumber.php index b74bd09..f03c640 100644 --- a/src/BigNumber.php +++ b/src/BigNumber.php @@ -10,7 +10,7 @@ /** * Common interface for arbitrary-precision rational numbers. */ -abstract class BigNumber implements \Serializable +abstract class BigNumber implements \Serializable, \JsonSerializable { /** * The regular expression used to parse integer, decimal and rational numbers. @@ -395,4 +395,12 @@ abstract public function toFloat(); * @return string */ abstract public function __toString(); + + /** + * {@inheritdoc} + */ + public function jsonSerialize() + { + return $this->__toString(); + } }