summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2026-04-12 08:18:10 +0200
committerRemi Collet <remi@php.net>2026-04-12 08:18:10 +0200
commita1e4a14e42e016c87852200d898f9b0b35e6b3da (patch)
tree5f118e760dc76b38962a7dd8d0788af2f991131b
parent876cd1cb5ab5714fa7d8d02752cd4c323a30d517 (diff)
update to 2.0.1
drop support for PHP < 8.2
-rw-r--r--PHPINFO2
-rw-r--r--REFLECTION807
-rw-r--r--php-pecl-decimal.spec38
3 files changed, 739 insertions, 108 deletions
diff --git a/PHPINFO b/PHPINFO
index d65aa36..4e35425 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -2,5 +2,5 @@
decimal
decimal support => enabled
-decimal version => 1.5.3
+decimal version => 2.0.1
libmpdec version => 4.0.1
diff --git a/REFLECTION b/REFLECTION
index 71218b7..0f04b9d 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,20 +1,20 @@
-Extension [ <persistent> extension #76 decimal version 1.5.3 ] {
+Extension [ <persistent> extension #76 decimal version 2.0.1 ] {
- - Classes [1] {
- Class [ <internal:decimal> final class Decimal\Decimal implements Stringable, JsonSerializable ] {
+ - Classes [3] {
+ Class [ <internal:decimal> abstract class Decimal\Number 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 ] { 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 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 }
}
@@ -22,75 +22,346 @@ Extension [ <persistent> extension #76 decimal version 1.5.3 ] {
- Static properties [0] {
}
- - Static methods [2] {
- Method [ <internal:decimal> static public method sum ] {
+ - Static methods [1] {
+ Method [ <internal:decimal> static public method valueOf ] {
- - Parameters [2] {
- Parameter #0 [ <required> $values ]
- Parameter #1 [ <optional> ?int $precision = <default> ]
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
+ }
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [33] {
+ Method [ <internal:decimal> abstract public method add ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> static public method avg ] {
+ Method [ <internal:decimal> abstract public method sub ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> abstract public method mul ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> abstract public method div ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> abstract public method pow ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $exponent ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> abstract public method mod ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> abstract public method shiftl ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $places ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> abstract public method shiftr ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $places ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> abstract public method round ] {
- Parameters [2] {
- Parameter #0 [ <required> $values ]
- Parameter #1 [ <optional> ?int $precision = <default> ]
+ Parameter #0 [ <optional> ?int $places = <default> ]
+ Parameter #1 [ <optional> ?int $mode = <default> ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> public method floor ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> public method ceil ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> public method trunc ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> public method abs ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> public method negate ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> public method isNaN ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method isInf ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method isInteger ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method isZero ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method isEven ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method isOdd ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method isPositive ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method isNegative ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> abstract public method toString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
+ }
+
+ Method [ <internal:decimal> abstract public method toFixed ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <optional> ?int $places = <default> ]
+ Parameter #1 [ <optional> ?bool $commas = <default> ]
+ Parameter #2 [ <optional> ?int $mode = <default> ]
+ }
+ - Return [ string ]
+ }
+
+ Method [ <internal:decimal> abstract public method toInt ] {
+
+ - Parameters [0] {
+ }
+ - Return [ int ]
+ }
+
+ Method [ <internal:decimal> abstract public method toFloat ] {
+
+ - Parameters [0] {
+ }
+ - Return [ float ]
+ }
+
+ Method [ <internal:decimal> public method toDecimal ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> int $precision ]
}
- Return [ Decimal\Decimal ]
}
+
+ Method [ <internal:decimal> public method toRational ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Rational ]
+ }
+
+ Method [ <internal:decimal> abstract public method compareTo ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $other ]
+ }
+ - Return [ int ]
+ }
+
+ Method [ <internal:decimal> public method between ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <required> $a ]
+ Parameter #1 [ <required> $b ]
+ Parameter #2 [ <optional> ?bool $inclusive = <default> ]
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method equals ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $other ]
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, prototype Stringable> public method __toString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
+ }
+
+ Method [ <internal:decimal, prototype JsonSerializable> public method jsonSerialize ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
+ }
}
+ }
- - Properties [0] {
+ Class [ <internal:decimal> final class Decimal\Decimal extends Decimal\Number implements JsonSerializable, Stringable ] {
+
+ - 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 string PI ] { 3.141592653589793 }
+ Constant [ public string E ] { 2.7182818284590452353602874713526625 }
+ }
+
+ - Static properties [0] {
}
- - Methods [41] {
- Method [ <internal:decimal, ctor> public method __construct ] {
+ - Static methods [1] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> static public method valueOf ] {
- Parameters [2] {
- Parameter #0 [ <optional> $value = <default> ]
- Parameter #1 [ <optional> int $precision = <default> ]
+ Parameter #0 [ <required> $value ]
+ Parameter #1 [ <optional> ?int $precision = <default> ]
}
+ - Return [ Decimal\Number ]
}
+ }
- Method [ <internal:decimal> public method copy ] {
+ - Properties [0] {
+ }
+
+ - Methods [45] {
+ Method [ <internal:decimal, ctor> private method __construct ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
}
- Method [ <internal:decimal> public method add ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method add ] {
- Parameters [1] {
Parameter #0 [ <required> $value ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method sub ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method sub ] {
- Parameters [1] {
Parameter #0 [ <required> $value ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method mul ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method mul ] {
- Parameters [1] {
Parameter #0 [ <required> $value ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method div ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method div ] {
- Parameters [1] {
Parameter #0 [ <required> $value ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
Method [ <internal:decimal> public method rem ] {
@@ -98,96 +369,111 @@ Extension [ <persistent> extension #76 decimal version 1.5.3 ] {
- Parameters [1] {
Parameter #0 [ <required> $value ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method mod ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method mod ] {
- Parameters [1] {
Parameter #0 [ <required> $value ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method pow ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method pow ] {
- Parameters [1] {
Parameter #0 [ <required> $value ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method shiftl ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $places ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method shiftr ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $places ]
+ }
+ - Return [ Decimal\Number ]
}
Method [ <internal:decimal> public method ln ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
Method [ <internal:decimal> public method exp ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
Method [ <internal:decimal> public method log10 ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
Method [ <internal:decimal> public method sqrt ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method floor ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method floor ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method ceil ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method ceil ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method truncate ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method trunc ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method round ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method round ] {
- Parameters [2] {
Parameter #0 [ <optional> ?int $places = <default> ]
- Parameter #1 [ <optional> ?int $rounding = <default> ]
+ Parameter #1 [ <optional> ?int $mode = <default> ]
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method shift ] {
+ Method [ <internal:decimal> public method trim ] {
- - Parameters [1] {
- Parameter #0 [ <required> int $places ]
+ - Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
- Method [ <internal:decimal> public method trim ] {
+ Method [ <internal:decimal> public method reduce ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Number ]
}
Method [ <internal:decimal> public method precision ] {
@@ -197,130 +483,454 @@ Extension [ <persistent> extension #76 decimal version 1.5.3 ] {
- Return [ int ]
}
- Method [ <internal:decimal> public method signum ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method abs ] {
- Parameters [0] {
}
- - Return [ int ]
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method negate ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isEven ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isOdd ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
}
- Method [ <internal:decimal> public method parity ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isPositive ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isNegative ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isNaN ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isInf ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isInteger ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isZero ] {
+
+ - Parameters [0] {
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toFixed ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <optional> ?int $places = <default> ]
+ Parameter #1 [ <optional> ?bool $commas = <default> ]
+ Parameter #2 [ <optional> ?int $mode = <default> ]
+ }
+ - Return [ string ]
+ }
+
+ Method [ <internal:decimal> public method toScientific ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> ?int $precision = <default> ]
+ }
+ - Return [ string ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toInt ] {
- Parameters [0] {
}
- Return [ int ]
}
- Method [ <internal:decimal> public method abs ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toFloat ] {
- Parameters [0] {
}
+ - Return [ float ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toDecimal ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> int $precision = <default> ]
+ }
- Return [ Decimal\Decimal ]
}
- Method [ <internal:decimal> public method negate ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toRational ] {
- Parameters [0] {
}
- - Return [ Decimal\Decimal ]
+ - Return [ Decimal\Rational ]
}
- Method [ <internal:decimal> public method isEven ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method compareTo ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $other ]
+ }
+ - Return [ int ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method between ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <required> $a ]
+ Parameter #1 [ <required> $b ]
+ Parameter #2 [ <optional> ?bool $inclusive = <default> ]
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method equals ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $other ]
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method __serialize ] {
+
+ - Parameters [0] {
+ }
+ - Return [ array ]
+ }
+
+ Method [ <internal:decimal> public method __unserialize ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $data ]
+ }
+ }
+
+ Method [ <internal:decimal, inherits Decimal\Number, prototype Stringable> public method __toString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
+ }
+
+ Method [ <internal:decimal, inherits Decimal\Number, prototype JsonSerializable> public method jsonSerialize ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
+ }
+ }
+ }
+
+ Class [ <internal:decimal> final class Decimal\Rational extends Decimal\Number implements JsonSerializable, Stringable ] {
+
+ - 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 [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> static public method valueOf ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [38] {
+ Method [ <internal:decimal, ctor> private method __construct ] {
+
+ - Parameters [0] {
+ }
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method add ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method sub ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method mul ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method div ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method pow ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $exponent ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal> public method rem ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method mod ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method shiftl ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $places ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method shiftr ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $places ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method floor ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method ceil ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method trunc ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method round ] {
+
+ - Parameters [2] {
+ Parameter #0 [ <optional> ?int $places = <default> ]
+ Parameter #1 [ <optional> ?int $rounding = <default> ]
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method abs ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method negate ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Number ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isEven ] {
- Parameters [0] {
}
- Return [ bool ]
}
- Method [ <internal:decimal> public method isOdd ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isOdd ] {
- Parameters [0] {
}
- Return [ bool ]
}
- Method [ <internal:decimal> public method isPositive ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isPositive ] {
- Parameters [0] {
}
- Return [ bool ]
}
- Method [ <internal:decimal> public method isNegative ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isNegative ] {
- Parameters [0] {
}
- Return [ bool ]
}
- Method [ <internal:decimal> public method isNaN ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isNaN ] {
- Parameters [0] {
}
- Return [ bool ]
}
- Method [ <internal:decimal> public method isInf ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isInf ] {
- Parameters [0] {
}
- Return [ bool ]
}
- Method [ <internal:decimal> public method isInteger ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isInteger ] {
- Parameters [0] {
}
- Return [ bool ]
}
- Method [ <internal:decimal> public method isZero ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method isZero ] {
- Parameters [0] {
}
- Return [ bool ]
}
- Method [ <internal:decimal> public method toFixed ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toFixed ] {
- Parameters [3] {
Parameter #0 [ <optional> ?int $places = <default> ]
Parameter #1 [ <optional> ?bool $commas = <default> ]
- Parameter #2 [ <optional> ?int $rounding = <default> ]
+ Parameter #2 [ <optional> ?int $mode = <default> ]
+ }
+ - Return [ string ]
+ }
+
+ Method [ <internal:decimal> public method toScientific ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> ?int $precision = <default> ]
}
- Return [ string ]
}
- Method [ <internal:decimal> public method toString ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toString ] {
- Parameters [0] {
}
- Return [ string ]
}
- Method [ <internal:decimal> public method toInt ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toInt ] {
- Parameters [0] {
}
- Return [ int ]
}
- Method [ <internal:decimal> public method toFloat ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toFloat ] {
- Parameters [0] {
}
- Return [ float ]
}
- Method [ <internal:decimal> public method equals ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toDecimal ] {
- Parameters [1] {
- Parameter #0 [ <required> $other ]
+ Parameter #0 [ <required> int $precision ]
}
- - Return [ bool ]
+ - Return [ Decimal\Decimal ]
}
- Method [ <internal:decimal> public method compareTo ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method toRational ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Decimal\Rational ]
+ }
+
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method compareTo ] {
- Parameters [1] {
Parameter #0 [ <required> $other ]
@@ -328,23 +938,46 @@ Extension [ <persistent> extension #76 decimal version 1.5.3 ] {
- Return [ int ]
}
- Method [ <internal:decimal> public method between ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method between ] {
- - Parameters [2] {
- Parameter #0 [ <required> $op1 ]
- Parameter #1 [ <optional> $op2 = <default> ]
+ - Parameters [3] {
+ Parameter #0 [ <required> $a ]
+ Parameter #1 [ <required> $b ]
+ Parameter #2 [ <optional> ?bool $inclusive = <default> ]
}
- Return [ bool ]
}
- Method [ <internal:decimal, prototype Stringable> public method __toString ] {
+ Method [ <internal:decimal, overwrites Decimal\Number, prototype Decimal\Number> public method equals ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $other ]
+ }
+ - Return [ bool ]
+ }
+
+ Method [ <internal:decimal> public method __serialize ] {
+
+ - Parameters [0] {
+ }
+ - Return [ array ]
+ }
+
+ Method [ <internal:decimal> public method __unserialize ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $data ]
+ }
+ }
+
+ Method [ <internal:decimal, inherits Decimal\Number, prototype Stringable> public method __toString ] {
- Parameters [0] {
}
- Return [ string ]
}
- Method [ <internal:decimal, prototype JsonSerializable> public method jsonSerialize ] {
+ Method [ <internal:decimal, inherits Decimal\Number, prototype JsonSerializable> public method jsonSerialize ] {
- Parameters [0] {
}
diff --git a/php-pecl-decimal.spec b/php-pecl-decimal.spec
index 9dd74bd..a5c523f 100644
--- a/php-pecl-decimal.spec
+++ b/php-pecl-decimal.spec
@@ -15,7 +15,6 @@
%global pecl_name decimal
%global pie_vend php-%{pecl_name}
%global pie_proj ext-%{pecl_name}
-# After 20-json.ini
%global ini_name 40-%{pecl_name}.ini
%global _configure ../configure
@@ -30,7 +29,7 @@
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Summary: Arbitrary-precision floating-point decimal
License: MIT
-Version: 1.5.3
+Version: 2.0.1
Release: 1%{?dist}
%forgemeta
URL: %{forgeurl}
@@ -38,13 +37,11 @@ Source0: %{forgesource}
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel >= 7.4
-BuildRequires: %{?scl_prefix}php-json
+BuildRequires: %{?scl_prefix}php-devel >= 8.2
BuildRequires: mpdecimal-devel >= 2.4
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-Requires: %{?scl_prefix}php-json%{?_isa}
# Extension
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
@@ -90,13 +87,14 @@ EOF
%{?dtsenable}
%{__phpize}
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global
cd NTS
%configure \
--with-decimal \
--with-libdir=%{_lib} \
--with-php-config=%{__phpconfig}
-make %{?_smp_mflags}
+%make_build
%if %{with_zts}
cd ../ZTS
@@ -104,45 +102,40 @@ cd ../ZTS
--with-decimal \
--with-libdir=%{_lib} \
--with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# install config file
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
%check
-OPT="-n"
-[ -f %{php_extdir}/json.so ] && OPT="$OPT -d extension=json.so"
-
-# Minimal load test for NTS extension
-%{__php} $OPT \
+: Minimal load test for NTS extension
+%{__php} -n \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
%if %{with tests}
: Upstream test suite for NTS extension
-TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="$OPT -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
-REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php -q --show-diff
+TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
+%{__php} -n run-tests.php -q --show-diff %{?_smp_mflags}
%endif
%if %{with_zts}
-# Minimal load test for ZTS extension
-%{__ztsphp} $OPT \
+: Minimal load test for ZTS extension
+%{__ztsphp} -n \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
%endif
@@ -150,6 +143,7 @@ REPORT_EXIT_STATUS=1 \
%files
%license LICENSE
+%doc composer.json
%doc *.md
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -162,6 +156,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Sun Apr 12 2026 Remi Collet <remi@remirepo.net> - 2.0.1-1
+- update to 2.0.1
+- drop support for PHP < 8.2
+
* Sun Apr 12 2026 Remi Collet <remi@remirepo.net> - 1.5.3-1
- update to 1.5.3