Re: [RFC] PDO Float Type

From: Date: Tue, 11 Apr 2017 22:52:50 +0000
Subject: Re: [RFC] PDO Float Type
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-98773@lists.php.net to get a copy of this message
Hi Andrea, On 11/04/2017 19:25, Andrea Faulds wrote: > Matteo Beccati wrote: >> a PDO::PARAM_NUMERIC const that could in fact just be an alias for >> PDO::PARAM_STR for most of the drivers > > This is a technical solution to a documentation problem. Yes, and I'd tend to agree. But technically PDO::PARAM_NUMERIC could also allow to pass parameters in an appropriate format: I believe it wouldn't be much of an improvement for pdo_pgsql, but to be certain some level of investigation would be required. > I think it runs the risk of confusing people who do know what they're > doing, and assume NUMERIC is like FLOAT. Hey, that was precisely my point! ;) I.e. to assume that numeric and float are similar enough that PDO::PARAM_FLOAT would be a good fit for a numeric field. I know you meant it the other way around, but to me it is more confusing to use PARAM_STR for numerics when only PARAM_FLOAT is available as alternative vs using PARAM_FLOAT on a numeric when both are available. > I'd suggest adding a warning to the manual instead. I think that's a requirement in any case. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/

« previous php.internals (#98773) next »