From 2b855e80d64edce2f860768e90598103fad9619f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 12 Apr 2026 08:09:11 +0200 Subject: sync with v1 --- PHPINFO | 4 +- REFLECTION | 837 +++++++++---------------------------------------------------- 2 files changed, 118 insertions(+), 723 deletions(-) diff --git a/PHPINFO b/PHPINFO index fb3ebaa..d65aa36 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,5 +2,5 @@ decimal decimal support => enabled -decimal version => 2.0.0 -libmpdec version => 2.4.2 +decimal version => 1.5.3 +libmpdec version => 4.0.1 diff --git a/REFLECTION b/REFLECTION index d8f893c..71218b7 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,20 +1,20 @@ -Extension [ extension #109 decimal version 2.0.0 ] { +Extension [ extension #76 decimal version 1.5.3 ] { - - Classes [3] { - Class [ abstract class Decimal\Number implements JsonSerializable ] { + - Classes [1] { + Class [ final class Decimal\Decimal implements Stringable, JsonSerializable ] { - Constants [13] { - Constant [ public int DEFAULT_ROUNDING ] { 3 } Constant [ public int ROUND_UP ] { 101 } Constant [ public int ROUND_DOWN ] { 102 } Constant [ public int ROUND_CEILING ] { 103 } Constant [ public int ROUND_FLOOR ] { 104 } - Constant [ public int ROUND_HALF_UP ] { 1 } - Constant [ public int ROUND_HALF_DOWN ] { 2 } - Constant [ public int ROUND_HALF_EVEN ] { 3 } - Constant [ public int ROUND_HALF_ODD ] { 4 } - Constant [ public int ROUND_TRUNCATE ] { 105 } - Constant [ public int DEFAULT_PRECISION ] { 34 } + Constant [ public int ROUND_HALF_UP ] { 105 } + Constant [ public int ROUND_HALF_DOWN ] { 106 } + Constant [ public int ROUND_HALF_EVEN ] { 107 } + Constant [ public int ROUND_HALF_ODD ] { 108 } + Constant [ public int ROUND_TRUNCATE ] { 109 } + Constant [ public int DEFAULT_PRECISION ] { 28 } + Constant [ public int DEFAULT_ROUNDING ] { 107 } Constant [ public int MIN_PRECISION ] { 1 } Constant [ public int MAX_PRECISION ] { 999999999999999999 } } @@ -22,901 +22,305 @@ Extension [ extension #109 decimal version 2.0.0 ] { - Static properties [0] { } - - Static methods [1] { - Method [ static public method valueOf ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - } - - - Properties [0] { - } - - - Methods [33] { - Method [ abstract public method add ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ abstract public method sub ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ abstract public method mul ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ abstract public method div ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ abstract public method pow ] { - - - Parameters [1] { - Parameter #0 [ $exponent ] - } - - Return [ Decimal\Number ] - } - - Method [ abstract public method mod ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ abstract public method shiftl ] { - - - Parameters [1] { - Parameter #0 [ $places ] - } - - Return [ Decimal\Number ] - } - - Method [ abstract public method shiftr ] { - - - Parameters [1] { - Parameter #0 [ $places ] - } - - Return [ Decimal\Number ] - } - - Method [ abstract public method round ] { - - - Parameters [2] { - Parameter #0 [ int or NULL $places ] - Parameter #1 [ int or NULL $mode ] - } - - Return [ Decimal\Number ] - } - - Method [ public method floor ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method ceil ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method trunc ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method abs ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method negate ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method isNaN ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method isInf ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method isInteger ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method isZero ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method isEven ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method isOdd ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method isPositive ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method isNegative ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ abstract public method toString ] { - - - Parameters [0] { - } - - Return [ string ] - } - - Method [ abstract public method toFixed ] { - - - Parameters [3] { - Parameter #0 [ int or NULL $places ] - Parameter #1 [ bool or NULL $commas ] - Parameter #2 [ int or NULL $mode ] - } - - Return [ string ] - } - - Method [ abstract public method toInt ] { - - - Parameters [0] { - } - - Return [ int ] - } - - Method [ abstract public method toFloat ] { - - - Parameters [0] { - } - - Return [ float ] - } - - Method [ public method toDecimal ] { - - - Parameters [1] { - Parameter #0 [ int $precision ] - } - - Return [ Decimal\Decimal ] - } - - Method [ public method toRational ] { - - - Parameters [0] { - } - - Return [ Decimal\Rational ] - } - - Method [ abstract public method compareTo ] { - - - Parameters [1] { - Parameter #0 [ $other ] - } - - Return [ int ] - } - - Method [ public method between ] { - - - Parameters [3] { - Parameter #0 [ $a ] - Parameter #1 [ $b ] - Parameter #2 [ bool or NULL $inclusive ] - } - - Return [ bool ] - } - - Method [ public method equals ] { - - - Parameters [1] { - Parameter #0 [ $other ] - } - - Return [ bool ] - } - - Method [ public method __toString ] { - - - Parameters [0] { - } - - Return [ string ] - } - - Method [ public method jsonSerialize ] { - - - Parameters [0] { - } - - Return [ string ] - } - } - } - - Class [ final class Decimal\Decimal extends Decimal\Number implements JsonSerializable ] { - - - Constants [15] { - Constant [ public int DEFAULT_ROUNDING ] { 3 } - Constant [ public int ROUND_UP ] { 101 } - Constant [ public int ROUND_DOWN ] { 102 } - Constant [ public int ROUND_CEILING ] { 103 } - Constant [ public int ROUND_FLOOR ] { 104 } - Constant [ public int ROUND_HALF_UP ] { 1 } - Constant [ public int ROUND_HALF_DOWN ] { 2 } - Constant [ public int ROUND_HALF_EVEN ] { 3 } - Constant [ public int ROUND_HALF_ODD ] { 4 } - Constant [ public int ROUND_TRUNCATE ] { 105 } - Constant [ public int DEFAULT_PRECISION ] { 34 } - Constant [ public int MIN_PRECISION ] { 1 } - Constant [ public int MAX_PRECISION ] { 999999999999999999 } - Constant [ public object PI ] { 3.141592653589793 } - Constant [ public object E ] { 2.7182818284590452353602874713526625 } - } - - - Static properties [0] { - } - - - Static methods [1] { - Method [ static public method valueOf ] { - - - Parameters [2] { - Parameter #0 [ $value ] - Parameter #1 [ int or NULL $precision ] - } - - Return [ Decimal\Number ] - } - } - - - Properties [0] { - } - - - Methods [43] { - Method [ private method __construct ] { - - - Parameters [0] { - } - } - - Method [ public method add ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method sub ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method mul ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method div ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method rem ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method mod ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method pow ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method shiftl ] { - - - Parameters [1] { - Parameter #0 [ $places ] - } - - Return [ Decimal\Number ] - } - - Method [ public method shiftr ] { - - - Parameters [1] { - Parameter #0 [ $places ] - } - - Return [ Decimal\Number ] - } - - Method [ public method ln ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method exp ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method log10 ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method sqrt ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method floor ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method ceil ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method trunc ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } - - Method [ public method round ] { + - Static methods [2] { + Method [ static public method sum ] { - Parameters [2] { - Parameter #0 [ int or NULL $places ] - Parameter #1 [ int or NULL $mode ] + Parameter #0 [ $values ] + Parameter #1 [ ?int $precision = ] } - - Return [ Decimal\Number ] + - Return [ Decimal\Decimal ] } - Method [ public method trim ] { + Method [ static public method avg ] { - - Parameters [0] { + - Parameters [2] { + Parameter #0 [ $values ] + Parameter #1 [ ?int $precision = ] } - - Return [ Decimal\Number ] + - Return [ Decimal\Decimal ] } + } - Method [ public method reduce ] { - - - Parameters [0] { - } - - Return [ Decimal\Number ] - } + - Properties [0] { + } - Method [ public method precision ] { + - Methods [41] { + Method [ public method __construct ] { - - Parameters [0] { + - Parameters [2] { + Parameter #0 [ $value = ] + Parameter #1 [ int $precision = ] } - - Return [ int ] } - Method [ public method abs ] { + Method [ public method copy ] { - Parameters [0] { } - - Return [ Decimal\Number ] + - Return [ Decimal\Decimal ] } - Method [ public method negate ] { + Method [ public method add ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $value ] } - - Return [ Decimal\Number ] + - Return [ Decimal\Decimal ] } - Method [ public method isEven ] { + Method [ public method sub ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $value ] } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method isOdd ] { + Method [ public method mul ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $value ] } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method isPositive ] { + Method [ public method div ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $value ] } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method isNegative ] { + Method [ public method rem ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $value ] } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method isNaN ] { + Method [ public method mod ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $value ] } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method isInf ] { + Method [ public method pow ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $value ] } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method isInteger ] { + Method [ public method ln ] { - Parameters [0] { } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method isZero ] { + Method [ public method exp ] { - Parameters [0] { } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method toString ] { + Method [ public method log10 ] { - Parameters [0] { } - - Return [ string ] - } - - Method [ public method toFixed ] { - - - Parameters [3] { - Parameter #0 [ int or NULL $places ] - Parameter #1 [ bool or NULL $commas ] - Parameter #2 [ int or NULL $mode ] - } - - Return [ string ] - } - - Method [ public method toSci ] { - - - Parameters [1] { - Parameter #0 [ int or NULL $precision ] - } - - Return [ string ] + - Return [ Decimal\Decimal ] } - Method [ public method toInt ] { + Method [ public method sqrt ] { - Parameters [0] { } - - Return [ int ] + - Return [ Decimal\Decimal ] } - Method [ public method toFloat ] { + Method [ public method floor ] { - Parameters [0] { } - - Return [ float ] - } - - Method [ public method toDecimal ] { - - - Parameters [1] { - Parameter #0 [ int $precision ] - } - Return [ Decimal\Decimal ] } - Method [ public method toRational ] { + Method [ public method ceil ] { - Parameters [0] { } - - Return [ Decimal\Rational ] - } - - Method [ public method compareTo ] { - - - Parameters [1] { - Parameter #0 [ $other ] - } - - Return [ int ] - } - - Method [ public method between ] { - - - Parameters [3] { - Parameter #0 [ $a ] - Parameter #1 [ $b ] - Parameter #2 [ bool or NULL $inclusive ] - } - - Return [ bool ] - } - - Method [ public method equals ] { - - - Parameters [1] { - Parameter #0 [ $other ] - } - - Return [ bool ] + - Return [ Decimal\Decimal ] } - Method [ public method __toString ] { + Method [ public method truncate ] { - Parameters [0] { } - - Return [ string ] + - Return [ Decimal\Decimal ] } - Method [ public method jsonSerialize ] { + Method [ public method round ] { - - Parameters [0] { + - Parameters [2] { + Parameter #0 [ ?int $places = ] + Parameter #1 [ ?int $rounding = ] } - - Return [ string ] + - Return [ Decimal\Decimal ] } - } - } - - Class [ final class Decimal\Rational extends Decimal\Number implements JsonSerializable ] { - - - Constants [13] { - Constant [ public int DEFAULT_ROUNDING ] { 3 } - Constant [ public int ROUND_UP ] { 101 } - Constant [ public int ROUND_DOWN ] { 102 } - Constant [ public int ROUND_CEILING ] { 103 } - Constant [ public int ROUND_FLOOR ] { 104 } - Constant [ public int ROUND_HALF_UP ] { 1 } - Constant [ public int ROUND_HALF_DOWN ] { 2 } - Constant [ public int ROUND_HALF_EVEN ] { 3 } - Constant [ public int ROUND_HALF_ODD ] { 4 } - Constant [ public int ROUND_TRUNCATE ] { 105 } - Constant [ public int DEFAULT_PRECISION ] { 34 } - Constant [ public int MIN_PRECISION ] { 1 } - Constant [ public int MAX_PRECISION ] { 999999999999999999 } - } - - - Static properties [0] { - } - - Static methods [1] { - Method [ static public method valueOf ] { + Method [ public method shift ] { - Parameters [1] { - Parameter #0 [ $value ] + Parameter #0 [ int $places ] } - - Return [ Decimal\Number ] + - Return [ Decimal\Decimal ] } - } - - Properties [0] { - } - - - Methods [36] { - Method [ private method __construct ] { + Method [ public method trim ] { - Parameters [0] { } + - Return [ Decimal\Decimal ] } - Method [ public method add ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method sub ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method mul ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method div ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method pow ] { - - - Parameters [1] { - Parameter #0 [ $exponent ] - } - - Return [ Decimal\Number ] - } - - Method [ public method rem ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method mod ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - - Return [ Decimal\Number ] - } - - Method [ public method shiftl ] { - - - Parameters [1] { - Parameter #0 [ $places ] - } - - Return [ Decimal\Number ] - } - - Method [ public method shiftr ] { - - - Parameters [1] { - Parameter #0 [ $places ] - } - - Return [ Decimal\Number ] - } - - Method [ public method floor ] { + Method [ public method precision ] { - Parameters [0] { } - - Return [ Decimal\Number ] + - Return [ int ] } - Method [ public method ceil ] { + Method [ public method signum ] { - Parameters [0] { } - - Return [ Decimal\Number ] + - Return [ int ] } - Method [ public method trunc ] { + Method [ public method parity ] { - Parameters [0] { } - - Return [ Decimal\Number ] - } - - Method [ public method round ] { - - - Parameters [2] { - Parameter #0 [ int or NULL $places ] - Parameter #1 [ int or NULL $rounding ] - } - - Return [ Decimal\Number ] + - Return [ int ] } - Method [ public method abs ] { + Method [ public method abs ] { - Parameters [0] { } - - Return [ Decimal\Number ] + - Return [ Decimal\Decimal ] } - Method [ public method negate ] { + Method [ public method negate ] { - Parameters [0] { } - - Return [ Decimal\Number ] + - Return [ Decimal\Decimal ] } - Method [ public method isEven ] { + Method [ public method isEven ] { - Parameters [0] { } - Return [ bool ] } - Method [ public method isOdd ] { + Method [ public method isOdd ] { - Parameters [0] { } - Return [ bool ] } - Method [ public method isPositive ] { + Method [ public method isPositive ] { - Parameters [0] { } - Return [ bool ] } - Method [ public method isNegative ] { + Method [ public method isNegative ] { - Parameters [0] { } - Return [ bool ] } - Method [ public method isNaN ] { + Method [ public method isNaN ] { - Parameters [0] { } - Return [ bool ] } - Method [ public method isInf ] { + Method [ public method isInf ] { - Parameters [0] { } - Return [ bool ] } - Method [ public method isInteger ] { + Method [ public method isInteger ] { - Parameters [0] { } - Return [ bool ] } - Method [ public method isZero ] { + Method [ public method isZero ] { - Parameters [0] { } - Return [ bool ] } - Method [ public method toFixed ] { + Method [ public method toFixed ] { - Parameters [3] { - Parameter #0 [ int or NULL $places ] - Parameter #1 [ bool or NULL $commas ] - Parameter #2 [ int or NULL $mode ] - } - - Return [ string ] - } - - Method [ public method toSci ] { - - - Parameters [1] { - Parameter #0 [ int or NULL $precision ] + Parameter #0 [ ?int $places = ] + Parameter #1 [ ?bool $commas = ] + Parameter #2 [ ?int $rounding = ] } - Return [ string ] } - Method [ public method toString ] { + Method [ public method toString ] { - Parameters [0] { } - Return [ string ] } - Method [ public method toInt ] { + Method [ public method toInt ] { - Parameters [0] { } - Return [ int ] } - Method [ public method toFloat ] { + Method [ public method toFloat ] { - Parameters [0] { } - Return [ float ] } - Method [ public method toDecimal ] { + Method [ public method equals ] { - Parameters [1] { - Parameter #0 [ int $precision ] - } - - Return [ Decimal\Decimal ] - } - - Method [ public method toRational ] { - - - Parameters [0] { + Parameter #0 [ $other ] } - - Return [ Decimal\Rational ] + - Return [ bool ] } - Method [ public method compareTo ] { + Method [ public method compareTo ] { - Parameters [1] { Parameter #0 [ $other ] @@ -924,32 +328,23 @@ Extension [ extension #109 decimal version 2.0.0 ] { - Return [ int ] } - Method [ public method between ] { - - - Parameters [3] { - Parameter #0 [ $a ] - Parameter #1 [ $b ] - Parameter #2 [ bool or NULL $inclusive ] - } - - Return [ bool ] - } - - Method [ public method equals ] { + Method [ public method between ] { - - Parameters [1] { - Parameter #0 [ $other ] + - Parameters [2] { + Parameter #0 [ $op1 ] + Parameter #1 [ $op2 = ] } - Return [ bool ] } - Method [ public method __toString ] { + Method [ public method __toString ] { - Parameters [0] { } - Return [ string ] } - Method [ public method jsonSerialize ] { + Method [ public method jsonSerialize ] { - Parameters [0] { } -- cgit