On Wed, 26 Apr 2023, Alexander Pravdin wrote: > A `decimal` builtin scalar type with some predefined precision > (probably configured in php.ini). I can set the precision explicitly > like `decimal(10,4)`.
Introducing a real decimal type is not an easy feat. First of all, we would probably need to bundle a library — such as MongoDB does: https://github.com/mongodb/mongo/tree/master/src/third_party/IntelRDFPMathLib20U1 Adding another scalar type also means that support for this needs to be added a lot of code paths in the source code, as well as in tools (IDEs, static analysers, debuggers). And then additionally semantics needs to be created on what to do if you add the existing float or int types to these new decimal types. > Good solution: > Make the php-decimal PEAR extension built-in and available by default. You mean the PECL extension (http://pecl.php.net/package/decimal)? This is possible, but I am not sure how much of a use case there is for these Decimal types and therefore I am slightly reluctant to add real native scalar decimal types, as it is such a large endeavour. cheers, Derick
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php