Re: PDO::PARAM_DOUBLE
| From: | Andrea Faulds | Date: | Thu, 08 Dec 2016 21:23:08 +0000 |
| Subject: | Re: PDO::PARAM_DOUBLE | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97342@lists.php.net to get a copy of this message | ||
Hi,
Matteo Beccati wrote:
Hi Adam, On 07/12/2016 23:37, Adam Baratz wrote:On the subject of naming, if we were to add this, I would think the name should be PDO::PARAM_FLOAT instead, as that's the more common name for the PHP float type now. It's IS_DOUBLE internally, but that is mostly an implementation detail, like IS_LONG. Thanks. -- Andrea Faulds https://ajf.me/It's not about naming. Double is relevant both to PHP and SQL and is a floating point type. On the other hand, decimal/numeric fields should be represented as strings as they are fixed point/precision, which is something we don't have in stock php. In fact bcmath uses strings too.For decimal, double wouldn't be the correct type anyway, as it could cause loss of precision.Sure, agree the name is imprecise. "Double" is mainly relevant to zvals.