Re: [RFC] Config setting to force all math operations to pass through BCMath library.

From: Date: Tue, 06 Mar 2012 21:37:36 +0000
Subject: Re: [RFC] Config setting to force all math operations to pass through BCMath library.
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-58688@lists.php.net to get a copy of this message
On Tue, Mar 6, 2012 at 4:31 PM, Anthony Ferrara <ircmaxell@gmail.com> wrote: > > Actually, I see that as even worse.  Why would 2 * 4 be possible to be > different from pow(2, 3)?  That doesn't really make sense (to me).  I > think if it was added, all of the math related extensions would need > to be (should be) updated as suits.  Otherwise 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.  So 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.

« previous php.internals (#58688) next »