Re: Thoughts on Feature Request - Arithmetic
| From: | Nathan Rixham | Date: | Fri, 07 Dec 2007 18:41:44 +0000 |
| Subject: | Re: Thoughts on Feature Request - Arithmetic | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33844@lists.php.net to get a copy of this message | ||
I've thought about this for the remainder of the day, and I can't see any good reason why this functionality should not be implemented into the core; it's basic fucntionality, a safe way of doing things and couldn't take more than a day or two to add in from a single developer, and surely it'd be no more than a couple of kb's worth compiled, if that!
Also, it's a bit of minor piece of functionality to warrent a PECL/PEAR Extension, and even more hassle for somebody to reasearch, find and download it - all to do some basic arithmetic.
Can anybody give me an argument as to why this functionality should not be incorporated into the core?
Many Regards
Nathan Rixham
Alexey Zakhlestin wrote:
On 12/7/07, Mike <ipso@snappymail.ca> wrote:Yes, an easy way to handle this functionality that is safe to use with user input would be REALLY nice. Specifically for allowing users to specify custom formulas to do all sorts of nifty stuff. Especially in reporting and payroll/commission applications. We're currently working on a reporting class where we would like the user to able to specify custom columns in XML, ie: $col5 = ($col1 / $col2) * ($col3 / $col4) Or in our payroll application where customers want to calculate custom commissions for sales people: $commission = ($gross_sales - $gross_pay - $medical_benefits - $chargebacks) * $employee_commission_bracketIn this case, you might find embedding usable… http://pecl.php.net/package/lua http://pecl.php.net/package/python http://pecl.php.net/package/perl