Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33844 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68417 invoked by uid 1010); 7 Dec 2007 18:43:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 68402 invoked from network); 7 Dec 2007 18:43:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2007 18:43:39 -0000 X-Host-Fingerprint: 82.41.129.160 82-41-129-160.cable.ubr02.glen.blueyonder.co.uk Received: from [82.41.129.160] ([82.41.129.160:16372] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/30-00432-85499574 for ; Fri, 07 Dec 2007 13:43:38 -0500 Message-ID: To: internals@lists.php.net Date: Fri, 07 Dec 2007 18:41:44 +0000 Reply-To: nrixham@gmail.com User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 References: <01.E6.00959.D3E59574@pb1.pair.com> <1197049033.26965.141.camel@ipso.snappymail.ca> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 82.41.129.160 Subject: Re: [PHP-DEV] Thoughts on Feature Request - Arithmetic From: nrixham@gmail.com (Nathan Rixham) 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 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_bracket > > In 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 >