Re: Re: PDO types

From: Date: Sun, 20 Feb 2005 14:44:41 +0000
Subject: Re: Re: PDO types
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-15122@lists.php.net to get a copy of this message
On Sun, 20 Feb 2005 12:36:01 +0100, Timm Friebe <thekid@thekid.de> wrote: > * If the number does not fit, I will try to convert it into a double > (PHP datatype float). This is the case for e.g. numeric(10) - values > might not fit. This is the same what PHP does when adding 1 to > LONG_MAX, for instance. If - in the procedure of doing so, strtod() > gives an ERANGE or if the length overflows EG(precision), I will > return a string. This is exactly what I wanted to avoid. Please don't make this change. > For "floats" > * If the length of the returned value exceeds EG(precision) or if > strtod() returns an ERANGE, I will return a string; a float otherwise. "Thou shall only return a float if the database passes you back a float; thou shalt not convert data into the floating point type." Floats suck. If the database gives you a decimal, pass it back as a string. > Talking about that, maybe PDO should start returning Date objects > instead of stupid string representations or sequences of numbers of > those (where users will start preg_match()ing or strtotime()ing around > if they want to do arithmetic with the returned value)... Derick and Pierre have something in mind for the future. --Wez.

« previous php.internals (#15122) next »