[RFC] PDO Float Type
| From: | Adam Baratz | Date: | Wed, 05 Apr 2017 15:30:14 +0000 |
| Subject: | [RFC] PDO Float Type | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-98733@lists.php.net to get a copy of this message | ||
Hi,
The PDO extension does not have a type to represent floating point values.
The current recommended practice is to use PDO::PARAM_STR.
I had poked at this topic in an earlier thread:
https://externals.io/thread/551
There was some hesitation about how complicated this would be to implement.
After looking through each of the supported drivers, it seems like it would
actually be a fairly light lift. In some cases, switching PDO::PARAM_STR
for a new float type constant will save a type cast and have the same
results.
I wrote up a proposal here:
https://wiki.php.net/rfc/pdo_float_type
I tried to be as thorough as possible in understanding the impact on each
supported driver. I'd appreciate any feedback on this concept as well as
its impact on drivers.
Thanks,
Adam