Re: [RFC] Floating Point support in GMP extension
| From: | Park Framework | Date: | Thu, 24 Apr 2014 22:29:10 +0000 |
| Subject: | Re: [RFC] Floating Point support in GMP extension | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-73788@lists.php.net to get a copy of this message | ||
Yes agree, it the right thing.
In many business calculations implemented pattern Money.
If there is a class BCMath or GMPFloat which it is possible to extend,
wherein overload operators, will interesting solutions.
<?php
class Money extends BCMath
{
protected $rate;
protected $amount;
protected $currency;
//....
}
?>
2014-04-25 0:33 GMT+03:00 Stas Malyshev <smalyshev@sugarcrm.com>:
> Hi!
>
> > How to make PHP userland class, overloading math operators?
>
> From userland it is impossible, this is why I was talking about what was
> done in GMP - converting extension to support operators, on extension
> level.
>
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
>