use Money\Money;
$value = Money::GBP(1);
// Actual divisor value not important, just has to be a float and less than 1.
$result = $value->divide(0.5);
var_dump($result);
PHP Warning: gmp_cmp(): Unable to convert variable to GMP - string is not an integer in /home/me/Documents/Projects/moneytest/vendor/moneyphp/money/src/Calculator/GmpCalculator.php on line 56
PHP Stack trace:
PHP 1. {main}() /home/me/Documents/Projects/moneytest/test.php:0
PHP 2. Money\Money->divide() /home/me/Documents/Projects/moneytest/test.php:8
PHP 3. Money\Calculator\GmpCalculator->compare() /home/me/Documents/Projects/moneytest/vendor/moneyphp/money/src/Money.php:338
PHP 4. gmp_cmp() /home/me/Documents/Projects/moneytest/vendor/moneyphp/money/src/Calculator/GmpCalculator.php:56
Some code to reproduce it -
expected result, something like -
actual result -
PHP version
7.4.3