Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58688 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76099 invoked from network); 6 Mar 2012 21:37:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Mar 2012 21:37:40 -0000 Authentication-Results: pb1.pair.com header.from=dmgx.michael@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmgx.michael@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: dmgx.michael@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:42172] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/DE-32184-3A3865F4 for ; Tue, 06 Mar 2012 16:37:40 -0500 Received: by wibhj13 with SMTP id hj13so2850265wib.29 for ; Tue, 06 Mar 2012 13:37:37 -0800 (PST) Received-SPF: pass (google.com: domain of dmgx.michael@gmail.com designates 10.216.138.129 as permitted sender) client-ip=10.216.138.129; Authentication-Results: mr.google.com; spf=pass (google.com: domain of dmgx.michael@gmail.com designates 10.216.138.129 as permitted sender) smtp.mail=dmgx.michael@gmail.com; dkim=pass header.i=dmgx.michael@gmail.com Received: from mr.google.com ([10.216.138.129]) by 10.216.138.129 with SMTP id a1mr8985506wej.49.1331069856996 (num_hops = 1); Tue, 06 Mar 2012 13:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=AEzAXARfs//8s/pC3mgMU4dsSJ6PubBdWuK5XeiVaqw=; b=xqujKUCBhK1uQDGFd7/4t6tO+4G4hylENunYu8Wfs6TPRF5ZiutZuxmviXfTfCmhpE eTtxRl5wZjpkdBb1W2MkZ9aQxmdaaYAmMRRNA7WFE2fqHux4dhnZYBhXjlzTZ9axQEmV ouSEeOPXaNsmN+cSkW9yRVPnsPtOeE2kS3EqKdbsQ6+RiloJxaBV8X8sRdTPoWPKT+Y7 DXHZNKzt5mkn+C+CIB7anaSGgM4TB6zmZDJkScWKBpTXiLrPt57Esm5pbNRclKNLBRPo tEayoOXu3B45QAvH3BcqCtY3KVpFtNqimtVOhFsGI3uQdeJPsqkDctSLo51ox8un+jo8 cPQg== MIME-Version: 1.0 Received: by 10.216.138.129 with SMTP id a1mr7134405wej.49.1331069856950; Tue, 06 Mar 2012 13:37:36 -0800 (PST) Received: by 10.216.51.68 with HTTP; Tue, 6 Mar 2012 13:37:36 -0800 (PST) In-Reply-To: References: Date: Tue, 6 Mar 2012 16:37:36 -0500 Message-ID: To: PHP Internals List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Config setting to force all math operations to pass through BCMath library. From: dmgx.michael@gmail.com (Michael Morris) On Tue, Mar 6, 2012 at 4:31 PM, Anthony Ferrara wrote= : > > Actually, I see that as even worse. =A0Why would 2 * 4 be possible to be > different from pow(2, 3)? =A0That doesn't really make sense (to me). =A0I > think if it was added, all of the math related extensions would need > to be (should be) updated as suits. =A0Otherwise it's just another > random inconsistency... The problem is that not all the math functions have BCmath equivalents. Bit of scope creep here if that is to be done. > > > When I said BC break, I'm talking about at the engine level. =A0So all > 3pd code that hooks into the engine (PECL extensions mainly) would be > broken, as the structure of the ZVal would need to change to > accommodate the bignum representation... BCMath returns the value as a string. I don't know what the ramification of that inside the engine is, but numbers end up being held as strings when this is active. I'm not trying to make light of these problems - they are significant. But PHP's current behavior is, to a non-cs major, not intuitive. I've progressed in my career to where I personally aren't bothered by this problem, but there are a lot of beginning scripters that can be caught with this.