Giter Site home page Giter Site logo

php-decimal / ext-decimal Goto Github PK

View Code? Open in Web Editor NEW
336.0 336.0 19.0 366 KB

Correctly-rounded, arbitrary precision decimal floating-point arithmetic in PHP

Home Page: https://php-decimal.github.io/

License: MIT License

M4 0.55% C 45.40% PHP 53.75% JavaScript 0.30%
arbitrary-precision decimal php

ext-decimal's Introduction

PHP Decimal Extension

Packagist

This is the reference package to use when adding the decimal extension as a dependency.

It provides:

  • Semantic versioning.
  • Implicit dependency on ext-decimal.
  • Implicit stubs for IDE integration.
composer require php-decimal/php-decimal

Also see:

ext-decimal's People

Contributors

bobvandevijver avatar cmb69 avatar flexboom avatar fruit avatar jan-e avatar krakjoe avatar remicollet avatar rtheunissen avatar weltling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ext-decimal's Issues

Issue with VC17 not compatible

I am using xampp with PHP Version 7.4.14. This php version using

Compiler Visual C++ 2017
Architecture x64

but i didn't find any compatible version of this.
Also PHP throws error of unable to load dynamic extension.

error installing version 1.1.0

First, thank you for creating this extension. I have used bcmath extensively and am looking forward to trying out this new extension.

I am running on CentOS 7.5. I was able to install version 1.0.1 with PECL, but getting an error installing 1.1.0:

checking for libmpdec library in default path... Could not find libmpdec
configure: error: Please reinstall the libmpdec distribution from http://www.bytereef.org/mpdecimal/

When I install 1.0.1, I get:

checking for libmpdec files in default path... found in /usr

I installed mpdecimal and mpdecimal-devel from EPEL (https://fedoraproject.org/wiki/EPEL). I have these files in /usr/lib64:

/usr/lib64/libmpdec.so
/usr/lib64/libmpdec.so.2
/usr/lib64/libmpdec.so.2.4.2

Please let me know if I can provide more information to help reproduce this.

Thanks for your help.

[2.0.0] undefined symbol: php_decimal_mpd_to_eng

+ /usr/bin/php -n -d extension=json.so --define extension=/dev/shm/BUILDROOT/php-pecl-decimal-2.0.0-1.fc31.remi.7.3.x86_64/usr/lib64/php/modules/decimal.so --modules
+ grep decimal
PHP Warning:  PHP Startup: Unable to load dynamic library '/dev/shm/BUILDROOT/php-pecl-decimal-2.0.0-1.fc31.remi.7.3.x86_64/usr/lib64/php/modules/decimal.so' (tried: /dev/shm/BUILDROOT/php-pecl-decimal-2.0.0-1.fc31.remi.7.3.x86_64/usr/lib64/php/modules/decimal.so (/dev/shm/BUILDROOT/php-pecl-decimal-2.0.0-1.fc31.remi.7.3.x86_64/usr/lib64/php/modules/decimal.so: undefined symbol: php_decimal_mpd_to_eng), /usr/lib64/php/modules//dev/shm/BUILDROOT/php-pecl-decimal-2.0.0-1.fc31.remi.7.3.x86_64/usr/lib64/php/modules/decimal.so.so (/usr/lib64/php/modules//dev/shm/BUILDROOT/php-pecl-decimal-2.0.0-1.fc31.remi.7.3.x86_64/usr/lib64/php/modules/decimal.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Error installing on CentOS 7.6

I am receiving the same error that was brought up in a previous issue

checking for libmpdec library in default path... Could not find libmpdec configure: error: Please reinstall the libmpdec distribution from http://www.byt ereef.org/mpdecimal/

I have the latest version of libmpdec installed by following the instructions listed http://www.bytereef.org/mpdecimal/quickstart.html when I attempt to reinstall I receive the following message

Requirement already satisfied: cdecimal in /usr/lib64/python3.6/site-packages

I also checked the /usr/lib64 folder and I have

/usr/lib64/libmpdec.so /usr/lib64/libmpdec.so.3 /usr/lib64/libmpdec.so.3.0.0

PHP Warning: Decimal\Decimal::__construct() expects exactly 1 parameter, 2

HI,
I am trying to use this extension on PHP 7.2.26 and Alpine 3.8 docker image.

use Decimal\Decimal;

$a = new Decimal("1", 2);
$b = new Decimal("7", 8);

print_r($a / $b);

This example code from documentation https://php-decimal.io/#basic-usage gives error

PHP Warning: Decimal\Decimal::__construct() expects exactly 1 parameter, 2 given in /app/public/index1.php on line 8 PHP Warning: Decimal\Decimal::__construct() expects exactly 1 parameter, 2 given in /app/public/index1.php on line 9 Assertion failed: dec->len > 0 (mpdecimal.c: mpd_msword: 216)

Trace:
`[New LWP 124]
[New LWP 125]
[New LWP 126]
Assertion failed: dec->len > 0 (mpdecimal.c: mpd_msword: 216)

Thread 1 "php" received signal SIGABRT, Aborted.
0x00007ffff7db2f1b in __restore_sigs () from /lib/ld-musl-x86_64.so.1
(gdb) bt
#0 0x00007ffff7db2f1b in __restore_sigs () from /lib/ld-musl-x86_64.so.1
#1 0x00007ffff7db3035 in raise () from /lib/ld-musl-x86_64.so.1
#2 0x0000000000000000 in ?? ()
`

Without 2nd parameter

use Decimal\Decimal;

$a = new Decimal("1");
$b = new Decimal("7");

print_r($a / $b);`

gives this error

Assertion failed: dec->len > 0 (mpdecimal.c: mpd_msword: 216)

Test failure with mpdecimal version 2.5

Everything OK with libmpdec version 2.4, but with version 2.5

TEST 9/100 [tests/Decimal/methods/ceil.phpt]
========DIFF========
001+ Array
002+ (
003+     [op1] => Decimal\Decimal Object
004+         (
005+             [value] => -INF
006+             [precision] => 34
007+         )
009+     [result] => Decimal\Decimal Object
010+         (
011+             [value] => NAN
012+             [precision] => 34
013+         )
014+ 
015+     [expect] => -INF
016+     [prec] => 34
017+ )
018+ Array
019+ (
020+     [op1] => Decimal\Decimal Object
021+         (
022+             [value] => INF
023+             [precision] => 34
024+         )
025+ 
026+     [result] => Decimal\Decimal Object
027+         (
028+             [value] => NAN
029+             [precision] => 34
030+         )
031+ 
032+     [expect] => INF
033+     [prec] => 34
034+ )
035+ Array
036+ (
037+     [op1] => Decimal\Decimal Object
038+         (
039+             [value] => INF
040+             [precision] => 10
041+         )
042+ 
043+     [result] => Decimal\Decimal Object
044+         (
045+             [value] => NAN
046+             [precision] => 10
047+         )
048+ 
049+     [expect] => INF
050+     [prec] => 10
051+ )
052+ Array
053+ (
054+     [op1] => Decimal\Decimal Object
055+         (
056+             [value] => -INF
057+             [precision] => 10
058+         )
059+ 
060+     [result] => Decimal\Decimal Object
061+         (
062+             [value] => NAN
063+             [precision] => 10
064+         )
065+ 
066+     [expect] => -INF
067+     [prec] => 10
068+ )
========DONE========
FAIL Decimal::ceil [tests/Decimal/methods/ceil.phpt] 


TEST 13/100 [tests/Decimal/methods/floor.phpt]
========DIFF========
001+ Array
002+ (
003+     [op1] => Decimal\Decimal Object
004+         (
005+             [value] => -INF
006+             [precision] => 34
007+         )
009+     [result] => Decimal\Decimal Object
010+         (
011+             [value] => NAN
012+             [precision] => 34
013+         )
014+ 
015+     [expect] => -INF
016+     [prec] => 34
017+ )
018+ Array
019+ (
020+     [op1] => Decimal\Decimal Object
021+         (
022+             [value] => INF
023+             [precision] => 34
024+         )
025+ 
026+     [result] => Decimal\Decimal Object
027+         (
028+             [value] => NAN
029+             [precision] => 34
030+         )
031+ 
032+     [expect] => INF
033+     [prec] => 34
034+ )
035+ Array
036+ (
037+     [op1] => Decimal\Decimal Object
038+         (
039+             [value] => INF
040+             [precision] => 10
041+         )
042+ 
043+     [result] => Decimal\Decimal Object
044+         (
045+             [value] => NAN
046+             [precision] => 10
047+         )
048+ 
049+     [expect] => INF
050+     [prec] => 10
051+ )
052+ Array
053+ (
054+     [op1] => Decimal\Decimal Object
055+         (
056+             [value] => -INF
057+             [precision] => 10
058+         )
059+ 
060+     [result] => Decimal\Decimal Object
061+         (
062+             [value] => NAN
063+             [precision] => 10
064+         )
065+ 
066+     [expect] => -INF
067+     [prec] => 10
068+ )
========DONE========
FAIL Decimal::floor [tests/Decimal/methods/floor.phpt] 


TEST 41/100 [tests/Decimal/methods/trunc.phpt]
========DIFF========
001+ Array
002+ (
003+     [op1] => Decimal\Decimal Object
004+         (
005+             [value] => -INF
006+             [precision] => 34
007+         )
009+     [result] => Decimal\Decimal Object
010+         (
011+             [value] => NAN
012+             [precision] => 34
013+         )
014+ 
015+     [expect] => -INF
016+     [prec] => 34
017+ )
018+ Array
019+ (
020+     [op1] => Decimal\Decimal Object
021+         (
022+             [value] => INF
023+             [precision] => 34
024+         )
025+ 
026+     [result] => Decimal\Decimal Object
027+         (
028+             [value] => NAN
029+             [precision] => 34
030+         )
031+ 
032+     [expect] => INF
033+     [prec] => 34
034+ )
035+ Array
036+ (
037+     [op1] => Decimal\Decimal Object
038+         (
039+             [value] => INF
040+             [precision] => 10
041+         )
042+ 
043+     [result] => Decimal\Decimal Object
044+         (
045+             [value] => NAN
046+             [precision] => 10
047+         )
048+ 
049+     [expect] => INF
050+     [prec] => 10
051+ )
052+ Array
053+ (
054+     [op1] => Decimal\Decimal Object
055+         (
056+             [value] => -INF
057+             [precision] => 10
058+         )
059+ 
060+     [result] => Decimal\Decimal Object
061+         (
062+             [value] => NAN
063+             [precision] => 10
064+         )
065+ 
066+     [expect] => -INF
067+     [prec] => 10
068+ )
========DONE========
FAIL Decimal::trunc [tests/Decimal/methods/trunc.phpt] 

Add helper functions

Since Decimal is a final class, we cannot extend the class with custom methods.
compareTo() gives us a comparison feature, but it's taking quite some time to get our minds wrapped around it every time.

It would be great with some helper functions:
greaterThan($other)
lessThan($other)
equalTo($other)
greaterThanOrEqualTo($other)
lessThanOrEqualTo($other)

Constructor tests fail after update to PHP 8.1

Just want to let you that after updating to PHP 8.1, one of the test-cases does fail.

Result

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Decimal::__construct [tests/php8/methods/__construct.phpt]
=====================================================================
⚡ make: *** [Makefile:133: test] Error 1

In the test-case NULL is passed to an scalar argument, which is deprecated in PHP 8.1. I managed to run the tests using the following workaround.

✎ sed -i s/new Decimal(0, null);/new Decimal(0, 0);/ tests/php8/methods/__construct.phpt
✎ make test

Dead project?

It has almost been a year since the last release, when can we expect a new version with PHP 8+ support and bug fixes?

MPD_DECIMAL128 context setup

Hello.
You library based on libmpdec 2.4+ that have support for IEE DECIMAL128.
But, i can't find, how to setup such context (MPD_DECIMAL128 or any other not-default context)

This is critically important for my task to make all calculations in PHP script with DECIMAL128 rules. So, please, suggest how can i do this.

Best regard,
Sergey

Incompatibility with pthreads

Environment

Summary

Without threads, operations work as expected.
As soon as operations are performed in a seperate thread, some result in "INF".

Reproducing Code

<?php

$thread = new class() extends Thread {

    public function run() {
        var_dump((new Decimal\Decimal("1"))->mul("9"));
        var_dump((new Decimal\Decimal("1"))->mul("10"));
    }
};

$thread->start() && $thread->join();
?>

Expected Output

object(Decimal\Decimal)#39 (2) {
  ["value"]=>
  string(1) "9"
  ["precision"]=>
  int(28)
}
object(Decimal\Decimal)#42 (2) {
  ["value"]=>
  string(2) "10"
  ["precision"]=>
  int(28)
}

Actual Output

object(Decimal\Decimal)#3 (2) {
  ["value"]=>
  string(1) "9"
  ["precision"]=>
  int(28)
}
PHP Warning:  Loss of data on string conversion in /app/test.php on line 7
object(Decimal\Decimal)#2 (2) {
  ["value"]=>
  string(3) "INF"
  ["precision"]=>
  int(28)
}

2.0.0 PECL release has wrong version

Version 2.0.0 is on PECL, and has a stability marked as alpha.

The name should be "2.0.0alpha1" or "2.0.0alpha1", otherwise systems like Composer will treat it as a stable release.

Please delete the release from PECL if at all possible and publish it again.

max(new Decimal(NAN), new Decimal(-INF)) give not correct result (-INF)

As we discussed in ##10
NAN is not comparable, must raise and exception OR return NAN
Because signum() have INT result, you decide to raise an exception for signum() (and i agree with this).
But, in case of min/max return of NAN seems to be better solution.

Important! I'm not sure that min()/max() assumed to be used with Decimal at all.
If so - then this issue must be fixed.
If Decimal not allowed to be used with min()/max() functions - then raise and exception would be good if one (or both) of argumens for min/max is Decimal. And, if Decimal wil be forbidden argument for PHP min()/max() then new Decimal->min(...)/Decimal->max(...) would be good idea for Decimal API.

P.S. Just info to @rtheunissen. min/max is last test case in our project (at least for now), so no new issues expected from me :).
And, i can send you PHPUnit test file for our Decimal wrapper. Maybe you will find something interesting ;)
P.P.S. I'm pretty happy with your fast answer/fixes.

Best regards,
Sergey

Equality with different precision

Is it possible to compare two decimals while ignoring their precision, or at least ignoring it where it doesn't matter? For example new Decimal('1', 8) and new Decimal('1', 2) should be equal, and so should new Decimal('1.234', 5) and new Decimal('1.234', 20), but new Decimal('1.234', 4) and new Decimal('1.2340001', 20) should be different. The best I have at the moment is to use toFixed() with the higher of the two precisions and compare the strings, but that's a bit hard to read.

TypeError: Decimal\Decimal::add() expected parameter 1 to be a string, integer, or decimal

Why Decimal does not accept float? It is a nuisance to make use of strval() or (string) in addition to checking that it is not NULL or empty.

use Decimal\Decimal;
class ModDecimal {
  public $decimal;
  function __construct($val = '') {
	  $var = strval(empty(trim($val))?'0':trim($val));
      $this->decimal = new Decimal($var);
  }
  function get_decimal() {
    return $this->decimal;
  }
}

$ok = (new ModDecimal(" 5.05"))->get_decimal()->add(20);
print_r($ok);

Decimal\Decimal Object
(
[value] => 25.05
[precision] => 28
)

PHP 7.4 Support

Hi,

PHP 7.4 is now released. Will there be a build for this soon as the current latest version does not load?

Decimal::mod() vs Decimal::rem()

First and foremost, thank you very much for bringing such a valuable library to PHP's world. We decided to drop our Decimal implementation in favour of PHPDecimal and it has proved to be a good decision so far.

I notice that in the docs you say the Decimal::mod() is the function that overloads the % operator. It is not exactly correct, as the % operator performs the remainder operation that is not the same as the modulo operation. As such, -3 mod 4 = 1 while -3 % 4 = -3, however $minus3->mod(4) == $minus4->rem(4) == -3. So, Decimal::mod() and Decimal::rem() are basically aliases here.

Besides fixing the docs about it (I can provide a PR for it :), I'd suggest changing Decimal::mod() to perform the modulo operation as it is quite useful.

Factorial function?

For the sake of performance it would be great to have a factorial function in the library. It's in the documentation but as a PHP implementation.

I use gmp for it at the moment. I'm not sure if it's linear or not but either way C will be much faster for very large numbers.

On another note, this library is able to compute pow much faster than bcmath for very large exponents. This library can calculate something that ends up at E-500000 very quickly but bcmath takes prohibitively long.

I would recommend it to people having problems with bcmath and bcpow.

Another thing that bothers me is why so many of this libraries don't support initialisation from native php float which is a bit mind boggling. I have to use number_format($n, 72, '.', '').

Inconsistent precision handling

Consider the following example

$a = new Decimal\Decimal('15.97', 10);
$b = new Decimal\Decimal('0.05', 3);
var_dump($a->abs());

This results in

class Decimal\Decimal#3 (2) {
  public $value =>
  string(4) "16.0"
  public $precision =>
  int(10)
}

which has 16.0, instead of the expected 15.97. Somehow, the last set precision on another, at that moment unrelated, instance influences the absolute calculation of the first subject.

This also results in some interesting behavior when continuing. Consider the following:

php > var_dump($a->abs()->rem($b));
class Decimal\Decimal#4 (2) {
  public $value =>
  string(4) "0.00"
  public $precision =>
  int(10)
}

Okay, this result is to be expected when you know the result of the first abs() call returned 16.0. But, but when re-executing the exact same line:

php > var_dump($a->abs()->rem($b));
class Decimal\Decimal#3 (2) {
  public $value =>
  string(4) "0.02"
  public $precision =>
  int(10)
}

It does come with the expected value!

TL;DR; The abs() should use the precision from the supplied object, and not of the latest precision set.

I do not know if there are any other methods that use the same assumption.

->signum() bug

Looks like i have found a bug. signum() for zero expected to be a zero. But, it is returns 1.

decimal support | enabled
decimal version | 1.1.0
libmpdec version | 2.4.2

Test code:

    $a = new Decimal(0);
    print_r($a);
    echo 'isZero? ', var_export($a->isZero(), true), "\n";
    echo 'signum: ', $a->signum(), "\n";
    $a = new Decimal(1);
    print_r($a);
    echo 'isZero? ', var_export($a->isZero(), true), "\n";
    echo 'signum: ', $a->signum(), "\n";
    $a = new Decimal(-1);
    print_r($a);
    echo 'isZero? ', var_export($a->isZero(), true), "\n";
    echo 'signum: ', $a->signum(), "\n";

Output:

Decimal\Decimal Object
(
    [value] => 0
    [precision] => 28
)
isZero? true
signum: 1
Decimal\Decimal Object
(
    [value] => 1
    [precision] => 28
)
isZero? false
signum: 1
Decimal\Decimal Object
(
    [value] => -1
    [precision] => 28
)
isZero? false
signum: -1

2.0.0-release time?

Need better consistency around scientific notation when converting to string or JSON.

Allow operations between decimal and floats

We are using the PHPDecimal library for a couple of months now, and the biggest issue we faced so far is the incompatibility between decimals and floats. Although in restrict contexts we (should) do not perform operations between float and decimal, there are some cases where this is desirable. The problem is that it is much easier to restrict where this should not happen than the other way around.

Because the class cannot handle floats, if you want this to be possible, you need to repeat the same boilerplate code everywhere:

new Decimal (\is_float($number) ? (string) $number : $number);

Now, look how tedious it is to sum a list of numbers that includes decimal, integers and floats:

/** @var array<int|float|Decimal> numbers **/
$sum = 0;
foreach ($numbers as $number) {
     if ($sum instanceof Decimal && \is_float($number)) {
         //...
     }

    if ($number instanceof Decimal && \is_float($sum)) {
         //...
    }

    $sum += $number;
}

...and for adding two numbers:

if ($leftNumber instanceof Decimal && \is_float($rightNumber)) {
    return (float) $leftNumber->toString() + $rightNumber;
}

if ($rightNumber instanceof Decimal && \is_float($leftNumber)) {
    return $leftNumber + (float) $rightNumber->toString();
}

return $leftNumber + $rightNumber;

On the other hand, if one wants to ensure that floats cannot be added to decimals, it is better to disallow floats in the input using type hints or static analysis tools, which is much more efficient.

One may argue that you should not add floats to decimals and vice versa, but in some applications it is a legal operation.

In that sense, I'd like to propose to relax that constraint and allow not only creating a decimal from a float, but also operations involving floats. A reasonable way to handle operations involving floats and decimal is converting the decimal operand to a float and then performing the operation. So, any operation between floats and decimals results in a float, the most inaccurate type between both. For edge cases, such as overflow and underflow, it should be consistent with PHP, where the result becomes -+inf and 0 respectively.

Although the former can be handled in a non-BC break way by introducing a named constructor such as Decimal::fromValue(), the latter requires a BC break.

Unable to load dynamic library 'php_decimal.dll'

Hello, i could not install the dll file to php in my windows 10.

I already added to "C:\xampp\php\ext" and "extension=php_decimal.dll" in php.ini.
But when i run "php --re decimal" will error :

PHP Warning: PHP Startup: Unable to load dynamic library 'php_decimal.dll' (tried: C:\xampp\php\ext\php_decimal.dll (The specified module could not be found.), C:\xampp\php\ext\php_php_decimal.dll.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'php_decimal.dll' (tried: C:\xampp\php\ext\php_decimal.dll (The specified module could not be found.), C:\xampp\php\ext\php_php_decimal.dll.dll (The specified module could not be found.)) in Unknown on line 0
Exception: Extension decimal does not exist

Can anyone help me here?

PHP 7.4.8 + opcache + decimal = segfault

Reported by a user of my repository, see
https://forum.remirepo.net/viewtopic.php?id=4019

With opcache + decimal

Here is the backtrace

[code](gdb) bt
#0  zend_mm_shutdown (silent=<optimized out>, full=1, heap=0x7ffff3c00040) at /usr/src/debug/php-7.4.8/Zend/zend_alloc.c:2255
#1  zend_mm_shutdown (heap=0x7ffff3c00040, full=1, silent=<optimized out>) at /usr/src/debug/php-7.4.8/Zend/zend_alloc.c:2206
#2  0x00005555557ee32a in php_module_shutdown () at /usr/src/debug/php-7.4.8/main/main.c:2498
#3  php_module_shutdown () at /usr/src/debug/php-7.4.8/main/main.c:2458
#4  0x00005555556571d4 in main (argc=3, argv=0x555555d73f50) at /usr/src/debug/php-7.4.8/sapi/cli/php_cli.c:1374
[/code]

Please consider adding a toDecimalString function

Thanks for the great library. I use the library in conjunction with PHP Money which means that sometimes I need to convert a Decimal to string and pass it to the PHP Money object to perform calculations.

Example:

$decimal = new \Decimal\Decimal('0.0000001');
$tenMillionUsd = new \Money\Money('10000000', new \Money\Currency('USD'));
$oneUsd = $tenMillionUsd->multiply((string)$decimal); // throws

The problem is that converting '0.0000001' to string results in '1E-7' which the money object cannot parse. Of course I could write $decimal->toFixed(Decimal::DEFAULT_PRECISION) but it's verbose, easy to forget and produces a lot of trailing zeros. I think it would help a lot of people if there was a toDecimalString function which would always return a decimal string in decimal notation without any trailing zeros.

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Running pecl install decimalI get this error:


Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Trying to access array offset on value of type null in Role.php on line 250
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 250

Notice: Trying to access array offset on value of type null in Role.php on line 251
PHP Notice:  Trying to access array offset on value of type null in /usr/share/php/PEAR/Installer/Role.php on line 251

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173
PHP Notice:  Undefined index: honorsbaseinstall in /usr/share/php/PEAR/Installer/Role.php on line 173

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139
PHP Notice:  Undefined index: installable in /usr/share/php/PEAR/Installer/Role.php on line 139

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204
PHP Notice:  Undefined index: phpfile in /usr/share/php/PEAR/Installer/Role.php on line 204

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46
PHP Notice:  Undefined index: config_vars in /usr/share/php/PEAR/Installer/Role.php on line 46

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249
XML Extension not found

I'm using:

PHP

PHP 7.4.3 (cli) (built: Feb 23 2020 07:24:28) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Ubuntu

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic

undefined symbol: php_json_serializable_ce

Can build, but then: undefined symbol: php_json_serializable_ce.

PHP Warning: PHP Startup: Unable to load dynamic library 'decimal.so' (tried: /usr/lib64/php/modules/decimal.so (/usr/lib64/php/modules/decimal.so: undefined symbol: php_json_serializable_ce), /usr/lib64/php/modules/decimal.so.so (/usr/lib64/php/modules/decimal.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0


Loading json.so before decimal.so seems to help; eg. /etc/php.d/98-json.ini and /etc/php.d/99-decimal.ini.

[2.0.0] segfault in ZTS

Various segfault running test suite on thread safe build

Ex:

(gdb) bt
#0  zval_internal_ptr_dtor (zval_ptr=0x555555b5fbf0) at /usr/src/debug/php-7.3.14-1.fc31.remi.x86_64/Zend/zend_variables.c:120
#1  0x0000555555807e2d in destroy_zend_class (zv=<optimized out>) at /usr/src/debug/php-7.3.14-1.fc31.remi.x86_64/Zend/zend_opcode.c:311
#2  0x000055555582467d in zend_hash_destroy (ht=0x555555b21600) at /usr/src/debug/php-7.3.14-1.fc31.remi.x86_64/Zend/zend_hash.c:1418
#3  0x0000555555811a45 in compiler_globals_dtor (compiler_globals=0x555555a26d00) at /usr/src/debug/php-7.3.14-1.fc31.remi.x86_64/Zend/zend.c:650
#4  0x00005555557a3c82 in tsrm_shutdown () at /usr/src/debug/php-7.3.14-1.fc31.remi.x86_64/TSRM/TSRM.c:192
#5  0x0000555555666516 in main (argc=62, argv=0x555555a221f0) at /usr/src/debug/php-7.3.14-1.fc31.remi.x86_64/sapi/cli/php_cli.c:1410

Does not install/compile on Homestead 11.0.0

Environment is Laravel Homestead 11.0.0, details pasted:

vagrant@homestead:~$ uname -a
Linux homestead 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
vagrant@homestead:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal
vagrant@homestead:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

libmpdec-dev dependency installs ok

vagrant@homestead:~$ sudo apt-get install libmpdec-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  libmpdec-doc
The following NEW packages will be installed:
  libmpdec-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 87.2 kB of archives.
After this operation, 410 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 libmpdec-dev amd64 2.4.2-3 [87.2 kB]
Fetched 87.2 kB in 0s (224 kB/s)      
Selecting previously unselected package libmpdec-dev:amd64.
(Reading database ... 179923 files and directories currently installed.)
Preparing to unpack .../libmpdec-dev_2.4.2-3_amd64.deb ...
Unpacking libmpdec-dev:amd64 (2.4.2-3) ...
Setting up libmpdec-dev:amd64 (2.4.2-3) ...

Trying to install

vagrant@homestead:~$ sudo pecl install decimal
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading decimal-1.3.1.tgz ...
Starting to download decimal-1.3.1.tgz (37,513 bytes)
..........done: 37,513 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version:         20200930
Zend Module Api No:      20200930
Zend Extension Api No:   420200930
building in /tmp/pear/temp/pear-build-rootH1lVYB/decimal-1.3.1
running: /tmp/pear/temp/decimal/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20200930
checking for PHP installed headers prefix... /usr/include/php/20200930
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable decimal support... yes, shared
checking for libmpdec custom path... no
checking for libmpdec library in default path... found in /usr/lib/x86_64-linux-gnu
checking for libmpdec headers in default path... found in /usr/include/x86_64-linux-gnu
checking for mpd_version in -lmpdec... yes
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-rootH1lVYB/decimal-1.3.1/libtool --mode=compile cc -I. -I/tmp/pear/temp/decimal -I/tmp/pear/temp/pear-build-rootH1lVYB/decimal-1.3.1/include -I/tmp/pear/temp/pear-build-rootH1lVYB/decimal-1.3.1/main -I/tmp/pear/temp/decimal -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib -I/usr/include/x86_64-linux-gnu  -DHAVE_CONFIG_H  -g -O2   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /tmp/pear/temp/decimal/php_decimal.c -o php_decimal.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/decimal -I/tmp/pear/temp/pear-build-rootH1lVYB/decimal-1.3.1/include -I/tmp/pear/temp/pear-build-rootH1lVYB/decimal-1.3.1/main -I/tmp/pear/temp/decimal -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib -I/usr/include/x86_64-linux-gnu -DHAVE_CONFIG_H -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /tmp/pear/temp/decimal/php_decimal.c  -fPIC -DPIC -o .libs/php_decimal.o
/tmp/pear/temp/decimal/php_decimal.c: In function ‘zim_Decimal___construct’:
/tmp/pear/temp/decimal/php_decimal.c:1896:9: warning: implicit declaration of function ‘Z_PARAM_STRICT_LONG’; did you mean ‘Z_PARAM_STR_OR_LONG’? [-Wimplicit-function-declaration]
 1896 |         Z_PARAM_STRICT_LONG(prec)
      |         ^~~~~~~~~~~~~~~~~~~
      |         Z_PARAM_STR_OR_LONG
/tmp/pear/temp/decimal/php_decimal.c:1896:34: error: expected ‘;’ before ‘}’ token
 1896 |         Z_PARAM_STRICT_LONG(prec)
      |                                  ^
      |                                  ;
In file included from /tmp/pear/temp/decimal/php_decimal.c:27:
/tmp/pear/temp/decimal/php_decimal.c: At top level:
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: implicit declaration of function ‘ZEND_TYPE_ENCODE_CLASS_CONST’; did you mean ‘ZEND_TYPE_INIT_CLASS_CONST’? [-Wimplicit-function-declaration]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1926:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1926 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(add, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1926:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1926 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(add, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_add[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1926:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1926 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(add, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1926:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1926 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(add, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_add[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1926:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1926 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(add, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1937:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1937 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sub, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_sub[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1937:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1937 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sub, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1937:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1937 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sub, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_sub[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1937:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1937 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sub, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1948:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1948 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(mul, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_mul[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1948:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1948 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(mul, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1948:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1948 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(mul, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_mul[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1948:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1948 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(mul, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1959:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1959 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(div, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_div[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1959:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1959 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(div, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1959:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1959 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(div, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_div[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1959:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1959 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(div, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1970:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1970 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(mod, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_mod[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1970:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1970 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(mod, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1970:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1970 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(mod, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_mod[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1970:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1970 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(mod, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1981:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1981 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(pow, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_pow[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1981:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1981 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(pow, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1981:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1981 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(pow, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_pow[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1981:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1981 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(pow, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1992:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1992 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(rem, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_rem[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1992:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1992 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(rem, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1992:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1992 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(rem, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_rem[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:1992:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 1992 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(rem, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2004:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2004 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(ln, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_ln[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2004:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2004 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(ln, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2004:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2004 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(ln, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_ln[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2004:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2004 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(ln, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2014:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2014 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(exp, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_exp[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2014:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2014 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(exp, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2014:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2014 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(exp, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_exp[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2014:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2014 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(exp, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2024:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2024 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(log10, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_log10[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2024:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2024 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(log10, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2024:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2024 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(log10, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_log10[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2024:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2024 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(log10, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2034:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2034 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sqrt, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_sqrt[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2034:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2034 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sqrt, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2034:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2034 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sqrt, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_sqrt[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2034:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2034 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sqrt, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2044:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2044 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(round, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_round[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2044:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2044 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(round, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2044:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2044 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(round, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_round[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2044:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2044 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(round, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c: In function ‘zim_Decimal_round’:
/tmp/pear/temp/decimal/php_decimal.c:2058:36: error: expected ‘;’ before ‘Z_PARAM_STRICT_LONG’
 2058 |         Z_PARAM_STRICT_LONG(places)
      |                                    ^
      |                                    ;
 2059 |         Z_PARAM_STRICT_LONG(rounding)
      |         ~~~~~~~~~~~~~~~~~~~
In file included from /tmp/pear/temp/decimal/php_decimal.c:27:
/tmp/pear/temp/decimal/php_decimal.c: At top level:
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2069:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2069 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(floor, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_floor[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2069:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2069 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(floor, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2069:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2069 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(floor, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_floor[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2069:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2069 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(floor, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2079:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2079 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(ceil, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_ceil[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2079:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2079 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(ceil, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2079:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2079 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(ceil, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_ceil[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2079:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2079 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(ceil, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2090:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2090 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(truncate, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_truncate[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2090:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2090 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(truncate, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2090:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2090 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(truncate, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_truncate[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2090:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2090 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(truncate, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2100:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2100 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(shift, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_shift[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2100:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2100 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(shift, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2100:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2100 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(shift, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_shift[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2100:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2100 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(shift, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c: In function ‘zim_Decimal_shift’:
/tmp/pear/temp/decimal/php_decimal.c:2111:36: error: expected ‘;’ before ‘}’ token
 2111 |         Z_PARAM_STRICT_LONG(places)
      |                                    ^
      |                                    ;
In file included from /tmp/pear/temp/decimal/php_decimal.c:27:
/tmp/pear/temp/decimal/php_decimal.c: At top level:
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2121:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2121 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(trim, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_trim[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2121:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2121 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(trim, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2121:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2121 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(trim, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_trim[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2121:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2121 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(trim, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2179:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2179 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(abs, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_abs[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2179:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2179 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(abs, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2179:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2179 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(abs, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_abs[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2179:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2179 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(abs, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2189:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2189 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(negate, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_negate[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2189:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2189 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(negate, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2189:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2189 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(negate, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_negate[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2189:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2189 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(negate, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /tmp/pear/temp/decimal/php_decimal.h:40,
                 from /tmp/pear/temp/decimal/php_decimal.c:27:
/tmp/pear/temp/decimal/php_decimal.c: In function ‘zim_Decimal_toFixed’:
/usr/include/php/20200930/Zend/zend_API.h:1330:2: error: lvalue required as increment operand
 1330 |  ++_i; \
      |  ^~
/usr/include/php/20200930/Zend/zend_API.h:1400:3: note: in expansion of macro ‘Z_PARAM_PROLOGUE’
 1400 |   Z_PARAM_PROLOGUE(deref, separate); \
      |   ^~~~~~~~~~~~~~~~
/usr/include/php/20200930/Zend/zend_API.h:1408:2: note: in expansion of macro ‘Z_PARAM_BOOL_EX2’
 1408 |  Z_PARAM_BOOL_EX2(dest, is_null, check_null, separate, separate)
      |  ^~~~~~~~~~~~~~~~
/usr/include/php/20200930/Zend/zend_API.h:1411:2: note: in expansion of macro ‘Z_PARAM_BOOL_EX’
 1411 |  Z_PARAM_BOOL_EX(dest, _dummy, 0, 0)
      |  ^~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2305:9: note: in expansion of macro ‘Z_PARAM_BOOL’
 2305 |         Z_PARAM_BOOL(commas)
      |         ^~~~~~~~~~~~
/usr/include/php/20200930/Zend/zend_API.h:1330:4: error: expected ‘;’ before ‘_i’
 1330 |  ++_i; \
      |    ^~
/usr/include/php/20200930/Zend/zend_API.h:1400:3: note: in expansion of macro ‘Z_PARAM_PROLOGUE’
 1400 |   Z_PARAM_PROLOGUE(deref, separate); \
      |   ^~~~~~~~~~~~~~~~
/usr/include/php/20200930/Zend/zend_API.h:1408:2: note: in expansion of macro ‘Z_PARAM_BOOL_EX2’
 1408 |  Z_PARAM_BOOL_EX2(dest, is_null, check_null, separate, separate)
      |  ^~~~~~~~~~~~~~~~
/usr/include/php/20200930/Zend/zend_API.h:1411:2: note: in expansion of macro ‘Z_PARAM_BOOL_EX’
 1411 |  Z_PARAM_BOOL_EX(dest, _dummy, 0, 0)
      |  ^~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2305:9: note: in expansion of macro ‘Z_PARAM_BOOL’
 2305 |         Z_PARAM_BOOL(commas)
      |         ^~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2306:38: error: expected ‘;’ before ‘}’ token
 2306 |         Z_PARAM_STRICT_LONG(rounding)
      |                                      ^
      |                                      ;
In file included from /tmp/pear/temp/decimal/php_decimal.c:27:
/tmp/pear/temp/decimal/php_decimal.c: At top level:
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2351:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2351 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(copy, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_copy[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2351:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2351 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(copy, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2351:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2351 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(copy, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_copy[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2351:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2351 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(copy, 0)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2416:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2416 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sum, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_sum[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2416:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2416 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sum, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2416:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2416 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sum, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_sum[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2416:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2416 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(sum, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c: In function ‘zim_Decimal_sum’:
/tmp/pear/temp/decimal/php_decimal.c:2429:34: error: expected ‘;’ before ‘}’ token
 2429 |         Z_PARAM_STRICT_LONG(prec)
      |                                  ^
      |                                  ;
In file included from /tmp/pear/temp/decimal/php_decimal.c:27:
/tmp/pear/temp/decimal/php_decimal.c: At top level:
/tmp/pear/temp/decimal/php_decimal.h:191:60: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2441:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2441 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(avg, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_avg[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2441:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2441 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(avg, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: error: initializer element is not constant
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2441:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2441 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(avg, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:191:60: note: (near initialization for ‘php_decimal_method_arginfo_avg[0].type.ptr’)
  191 |         {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_FQCN, 0), 0, 0},
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.h:216:5: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX’
  216 |     PHP_DECIMAL_ARGINFO_RETURN_DECIMAL_EX(name, required_num_args, method)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c:2441:1: note: in expansion of macro ‘PHP_DECIMAL_ARGINFO_RETURN_DECIMAL’
 2441 | PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(avg, 1)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/decimal/php_decimal.c: In function ‘zim_Decimal_avg’:
/tmp/pear/temp/decimal/php_decimal.c:2454:34: error: expected ‘;’ before ‘}’ token
 2454 |         Z_PARAM_STRICT_LONG(prec)
      |                                  ^
      |                                  ;
/tmp/pear/temp/decimal/php_decimal.c: In function ‘php_decimal_register_class_handlers’:
/tmp/pear/temp/decimal/php_decimal.c:2552:43: warning: assignment to ‘zend_object_clone_obj_t’ {aka ‘struct _zend_object * (*)(struct _zend_object *)’} from incompatible pointer type ‘zend_object * (*)(zval *)’ {aka ‘struct _zend_object * (*)(struct _zval_struct *)’} [-Wincompatible-pointer-types]
 2552 |     php_decimal_handlers.clone_obj        = php_decimal_clone_obj;
      |                                           ^
/tmp/pear/temp/decimal/php_decimal.c:2553:43: warning: assignment to ‘zend_object_cast_t’ {aka ‘int (*)(struct _zend_object *, struct _zval_struct *, int)’} from incompatible pointer type ‘php_success_t (*)(zval *, zval *, int)’ {aka ‘int (*)(struct _zval_struct *, struct _zval_struct *, int)’} [-Wincompatible-pointer-types]
 2553 |     php_decimal_handlers.cast_object      = php_decimal_cast_object;
      |                                           ^
/tmp/pear/temp/decimal/php_decimal.c:2554:43: warning: assignment to ‘zend_object_compare_t’ {aka ‘int (*)(struct _zval_struct *, struct _zval_struct *)’} from incompatible pointer type ‘php_success_t (*)(zval *, zval *, zval *)’ {aka ‘int (*)(struct _zval_struct *, struct _zval_struct *, struct _zval_struct *)’} [-Wincompatible-pointer-types]
 2554 |     php_decimal_handlers.compare          = php_decimal_compare_zval_to_zval;
      |                                           ^
/tmp/pear/temp/decimal/php_decimal.c:2556:43: warning: assignment to ‘zend_object_get_debug_info_t’ {aka ‘struct _zend_array * (*)(struct _zend_object *, int *)’} from incompatible pointer type ‘HashTable * (*)(zval *, int *)’ {aka ‘struct _zend_array * (*)(struct _zval_struct *, int *)’} [-Wincompatible-pointer-types]
 2556 |     php_decimal_handlers.get_debug_info   = php_decimal_get_debug_info;
      |                                           ^
/tmp/pear/temp/decimal/php_decimal.c:2557:43: warning: assignment to ‘zend_object_read_property_t’ {aka ‘struct _zval_struct * (*)(struct _zend_object *, struct _zend_string *, int,  void **, struct _zval_struct *)’} from incompatible pointer type ‘zval * (*)(zval *, zval *, int,  void **, zval *)’ {aka ‘struct _zval_struct * (*)(struct _zval_struct *, struct _zval_struct *, int,  void **, struct _zval_struct *)’} [-Wincompatible-pointer-types]
 2557 |     php_decimal_handlers.read_property    = php_decimal_read_property;
      |                                           ^
/tmp/pear/temp/decimal/php_decimal.c:2558:43: warning: assignment to ‘zend_object_write_property_t’ {aka ‘struct _zval_struct * (*)(struct _zend_object *, struct _zend_string *, struct _zval_struct *, void **)’} from incompatible pointer type ‘void (*)(zval *, zval *, zval *, void **)’ {aka ‘void (*)(struct _zval_struct *, struct _zval_struct *, struct _zval_struct *, void **)’} [-Wincompatible-pointer-types]
 2558 |     php_decimal_handlers.write_property   = php_decimal_write_property;
      |                                           ^
/tmp/pear/temp/decimal/php_decimal.c:2559:43: warning: assignment to ‘zend_object_has_property_t’ {aka ‘int (*)(struct _zend_object *, struct _zend_string *, int,  void **)’} from incompatible pointer type ‘int (*)(zval *, zval *, int,  void **)’ {aka ‘int (*)(struct _zval_struct *, struct _zval_struct *, int,  void **)’} [-Wincompatible-pointer-types]
 2559 |     php_decimal_handlers.has_property     = php_decimal_has_property;
      |                                           ^
/tmp/pear/temp/decimal/php_decimal.c:2560:43: warning: assignment to ‘zend_object_unset_property_t’ {aka ‘void (*)(struct _zend_object *, struct _zend_string *, void **)’} from incompatible pointer type ‘void (*)(zval *, zval *, void **)’ {aka ‘void (*)(struct _zval_struct *, struct _zval_struct *, void **)’} [-Wincompatible-pointer-types]
 2560 |     php_decimal_handlers.unset_property   = php_decimal_unset_property;
      |                                           ^
make: *** [Makefile:209: php_decimal.lo] Error 1
ERROR: `make' failed

Negative places in Decimal::toFixed causes memory allocation error

First up, thanks for this extension. It has made my life so much easier since I moved all of my code from bcmath to this.

I recently ran into a bug and am posting here to hopefully save someone time in the future.

Steps to reproduce:

docker run -it php:7.4.12-cli-buster bash
apt-get update
apt-get install -y libmpdec-dev
pecl install decimal
php -d "extension=decimal.so" -r '(new Decimal\Decimal(1))->toFixed(-1);'

Result:

Fatal error: Failed to allocate memory for decimal in Command line code on line 1

You could also use this script to reproduce if you already have a working installation of php with ext-decimal

<?php

$d = new Decimal\Decimal(1);
$d->toFixed(-1);

which outputs:

Fatal error: Failed to allocate memory for decimal in /path/decimaltest.php on line 4

I understand that passing a negative number to Decimal::toFixed is incorrect, but an uncatchable Fatal error with a message about memory allocation made tracking down the bug quite difficult. My suggestion, if anyone has the time or inclination to look at this, is to have a clearer error message here that the argument of -1 is invalid.

Thanks again

atan function

Hi,

I'm trying to find a way to implement atan PHP function with arbitrary precision, but I can't find any implementation.

It seems you can use the Maclaurin Series:

image

But I can not get even the basic PHP atan function precision.

Thanks.

Alpine equivalent libmpdec-dev

Hi,

I was unable to find the Alpine equivalent of the libmpdec-dev dependency. Do you know how to install it in Alpine?

Please consider adding `__debugInfo()`

Currently, I have to stringify/jsonify decimals to dump them, and it's painful to deal with it when it's in an array or some deep structure.

__debugInfo would be very helpful for debugging.

With some guidance, I could try implementing it myself.

default rounding mode for round calls

I understand the default rounding mode cannot be changed for internally reducing values to a precision, but would it be possible to set a default rounding mode for calls to ->round()? In my case, I'd like to always use a different rounding mode, but it requires me to set the rounding mode on every call to round().

I use bignumber.js which has something similar:

https://mikemcl.github.io/bignumber.js/#rounding-mode

Or is there another way this can be done without having to remember to pass the rounding mode on every call to round()? One way I thought of was if I could extend the Decimal class and override the round method, but I see the Decimal class is defined as final.

Thank you for your help.

Usage with native PHP functions?

The Decimal class does not seem to work very well with native PHP functions, e.g.:

$foo = new Decimal('123.4567');
echo round($foo, 2); // 123
echo round((float) $foo, 2); // 123.46

I would expect both round() calls to return 123.46, but it looks like the Decimal instance is casted to int when no explicit cast is done. Is this the expected behavior?

Testing on php8 with docker

Hello Everyone,

Not an issue di per se (on the contrary, thanks a lot for working on the ex-decimal)!
If you are interested in building PHP with ext-decimal support and you use docker, in your PHP Dockerfile just add this:

RUN mkdir -p /usr/src/php/ext/php-decimal \ && cd /usr/src/php/ext/php-decimal \ && git clone https://github.com/php-decimal/ext-decimal.git . \ && git checkout 1.x-php8 \ && docker-php-ext-install php-decimal

and build your docker. There is no need to add extension=decimal.so to your php.ini

It works like a charm!

Of course, it relies on the 1.x-php8 branch, which may not be supported for long, but as long as there won't be the updated official package, you can start building and testing

Thanks to the maintainers/supporters of the project!

php 8.0 will be supported?

now there are errors during compilation

/tmp/pear/temp/decimal/src/decimal.c: At top level: /tmp/pear/temp/decimal/src/arginfo.h:65:60: warning: initialization of 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion] {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_RATIONAL_FQCN, 0), 0, 0}, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/decimal/src/decimal.c:995:1: note: in expansion of macro 'PHP_DECIMAL_ARGINFO_RETURN_RATIONAL' PHP_DECIMAL_ARGINFO_RETURN_RATIONAL(Decimal, toRational, 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/decimal/src/arginfo.h:65:60: note: (near initialization for 'php_decimal_arginfo_Decimal_toRational[0].type.ptr') {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_RATIONAL_FQCN, 0), 0, 0}, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/decimal/src/decimal.c:995:1: note: in expansion of macro 'PHP_DECIMAL_ARGINFO_RETURN_RATIONAL' PHP_DECIMAL_ARGINFO_RETURN_RATIONAL(Decimal, toRational, 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/decimal/src/arginfo.h:65:60: error: initializer element is not constant {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_RATIONAL_FQCN, 0), 0, 0}, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/decimal/src/decimal.c:995:1: note: in expansion of macro 'PHP_DECIMAL_ARGINFO_RETURN_RATIONAL' PHP_DECIMAL_ARGINFO_RETURN_RATIONAL(Decimal, toRational, 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/decimal/src/arginfo.h:65:60: note: (near initialization for 'php_decimal_arginfo_Decimal_toRational[0].type.ptr') {(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_RATIONAL_FQCN, 0), 0, 0}, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Consider adding support for packed BCD

Hi!
I work on a msgpack extension that can pack/unpack fixed-point decimals that are stored in the following format:

+-------+--------------------------------+
| scale | packed BCD (2 digits per byte) |
+-------+--------------------------------+

I implemented packing/unpacking logic in pure PHP, but wonder if it would make sense to add support of packed decimals to this extension. Wdyt?

For example, here is how I pack them now:

$data = $value->toFixed(self::PRECISION);

if ('-' === $data[0]) {
    $nibble = 'd';
    $data = \substr($data, 1);
} else {
    $nibble = 'c';
}

$pieces = \explode('.', $data, 2);
$pieces[1] = \rtrim($pieces[1], '0');

$data = "{$pieces[0]}{$pieces[1]}{$nibble}";
if (0 !== \strlen($data) % 2) {
    $data = '0'.$data;
}

$scale = empty($pieces[1]) ? 0 : \strlen($pieces[1]);

return [$scale, \hex2bin($data)];

What is the max number that Decimal can represent?

If I use the float datatype, the limit on 64-bit PHP is 1.8e308

If I use the Int datatype, the limit on 64-bit PHP is 9223372036854775807

What is the limit of the Decimal datatype?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.